/* Общие стили «рабочего стола» и панели задач Win11 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}
.hero-stack {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  transition: opacity 0.55s ease-in-out;
}
[data-theme="light"] .hero-layer--light { opacity: 1; z-index: 1; }
[data-theme="light"] .hero-layer--dark { opacity: 0; z-index: 0; }
[data-theme="dark"] .hero-layer--light { opacity: 0; z-index: 0; }
[data-theme="dark"] .hero-layer--dark { opacity: 1; z-index: 1; }

/* Ярлыки разделов на рабочем столе (перетаскивание из меню «Пуск») */
.desktop-shortcuts-layer {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 48px;
  z-index: 2;
  pointer-events: auto;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.desktop-shortcuts-layer.is-drop-target {
  box-shadow: inset 0 0 0 2px rgba(0, 120, 212, 0.75);
}

.desktop-shortcuts-mount {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.desktop-shortcut {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 92px;
  max-width: 92px;
  margin: 0;
  padding: 6px 4px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-sizing: border-box;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  cursor: grab;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s ease;
}

.desktop-shortcut.is-dragging {
  z-index: 6;
  cursor: grabbing;
  touch-action: none;
  transition: none;
  opacity: 0.94;
}

body.medbot-desktop-dragging {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

.desktop-shortcut:hover,
.desktop-shortcut:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .desktop-shortcut:hover,
[data-theme="light"] .desktop-shortcut:focus-visible {
  background: rgba(255, 255, 255, 0.35);
}

.desktop-shortcut:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

.desktop-shortcut-iconbox {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

[data-theme="light"] .desktop-shortcut-iconbox {
  background: #f3f3f3;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .desktop-shortcut-iconbox {
  background: rgba(40, 40, 44, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.desktop-shortcut-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.desktop-shortcut-label {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
  -webkit-hyphens: none;
  width: 100%;
  max-height: 3.75em;
  pointer-events: none;
}

[data-theme="light"] .desktop-shortcut {
  color: #1a1a1a;
  text-shadow: none;
}

[data-theme="dark"] .desktop-shortcut {
  color: #fafafa;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.7);
}

.desktop-shortcut-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, background-color 0.12s ease;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-shortcut:hover .desktop-shortcut-remove,
.desktop-shortcut:focus-within .desktop-shortcut-remove {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .desktop-shortcut-remove {
    pointer-events: auto;
  }
}

.desktop-shortcut-remove:hover {
  background: rgba(196, 43, 28, 0.95);
}

.desktop-shortcut-remove:focus-visible {
  opacity: 1;
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

/* Пока идёт перетаскивание плитки из «Пуск», скрин не перехватывает drop — ярлык можно отпустить на стол */
body.medbot-dragging-from-start .start-host.is-open .start-scrim {
  pointer-events: none !important;
}

/* Контекстное меню раздела в «Пуск» (ПКМ → на рабочий стол) */
.start-section-ctx-menu {
  position: fixed;
  z-index: 20;
  min-width: 228px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 4px 0;
  margin: 0;
  border-radius: 8px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

[data-theme="light"] .start-section-ctx-menu {
  background: rgba(252, 252, 252, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

[data-theme="dark"] .start-section-ctx-menu {
  background: rgba(44, 44, 48, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fafafa;
}

.start-section-ctx-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.start-section-ctx-menu-item:hover:not(:disabled) {
  background: rgba(0, 103, 192, 0.1);
}

[data-theme="dark"] .start-section-ctx-menu-item:hover:not(:disabled) {
  background: rgba(96, 205, 255, 0.12);
}

.start-section-ctx-menu-item:disabled {
  opacity: 0.55;
  cursor: default;
}

.start-section-ctx-menu-item:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: -2px;
}

.start-menu-tile-wrap[draggable="true"] {
  cursor: grab;
}

.start-menu-tile-wrap[draggable="true"]:active {
  cursor: grabbing;
}

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
  box-sizing: border-box;
  backdrop-filter: blur(32px) saturate(1.15);
  -webkit-backdrop-filter: blur(32px) saturate(1.15);
  z-index: 10;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  border-top-width: 1px;
  border-top-style: solid;
  transition: background-color 0.5s ease, border-top-color 0.5s ease, box-shadow 0.5s ease;
}

.taskbar--lockscreen {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 8px 0 12px;
}
[data-theme="light"] .taskbar {
  background-color: rgba(243, 243, 243, 0.78);
  border-top-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.45) inset;
}
[data-theme="dark"] .taskbar {
  background-color: rgba(40, 40, 40, 0.82);
  border-top-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.04) inset;
}
.taskbar-tray {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.taskbar-reply-bell {
  position: relative;
  width: 36px;
  height: 36px;
  margin: 0 2px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

/* display:flex выше перебивает стандартное скрытие [hidden] — без этого колокольчик «висит» в трее всегда */
.taskbar-reply-bell[hidden] {
  display: none !important;
}

.taskbar-reply-bell:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .taskbar-reply-bell:hover {
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-reply-bell-icon {
  width: 20px;
  height: 20px;
  color: #c42b1c;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 1px rgba(196, 43, 28, 0.35));
}

.taskbar-reply-bell-glow {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 43, 28, 0.35) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.taskbar-reply-bell--active .taskbar-reply-bell-glow {
  opacity: 1;
  animation: taskbar-bell-glow-pulse 1.6s ease-in-out infinite;
}

.taskbar-reply-bell--active .taskbar-reply-bell-icon {
  animation: taskbar-bell-swing 1.2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes taskbar-bell-glow-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.45; }
  50% { transform: scale(1.08); opacity: 0.95; }
}

@keyframes taskbar-bell-swing {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .taskbar-reply-bell--active .taskbar-reply-bell-glow,
  .taskbar-reply-bell--active .taskbar-reply-bell-icon {
    animation: none;
  }
  .taskbar-reply-bell--active .taskbar-reply-bell-glow {
    opacity: 0.75;
  }
}

.taskbar-leading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 2px;
}

/* Явное скрытие: авторский display:flex не должен перекрывать атрибут hidden */
#sectionShellTaskbarMount[hidden] {
  display: none !important;
}

.section-shell-taskbar-mount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.taskbar-section-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.15s ease, color 0.45s ease;
}

.taskbar-section-app-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

[data-theme="light"] .taskbar-section-app-btn {
  color: #1c1c1c;
}

[data-theme="light"] .taskbar-section-app-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .taskbar-section-app-btn {
  color: #f3f3f3;
}

[data-theme="dark"] .taskbar-section-app-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-section-app-btn:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

.taskbar-section-app-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: #0078d4;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.taskbar-section-app-btn:not([hidden])::after {
  opacity: 1;
}

.taskbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 4px;
}

.taskbar-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.45s ease;
}

[data-theme="light"] .taskbar-start-btn { color: #1c1c1c; }
[data-theme="light"] .taskbar-start-btn:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] .taskbar-start-btn { color: #f3f3f3; }
[data-theme="dark"] .taskbar-start-btn:hover { background: rgba(255, 255, 255, 0.08); }

.taskbar-start-btn:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

[data-theme="light"] .taskbar-start-btn.is-active {
  background: rgba(0, 103, 192, 0.12);
}

[data-theme="dark"] .taskbar-start-btn.is-active {
  background: rgba(96, 205, 255, 0.14);
}

.taskbar-start-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.taskbar-start-logo svg {
  width: 18px;
  height: 18px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.45s ease, background-color 0.2s ease;
}
.theme-toggle:focus-visible { outline: 2px solid #0078d4; outline-offset: 1px; }
[data-theme="light"] .theme-toggle { color: #1c1c1c; }
[data-theme="light"] .theme-toggle:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] .theme-toggle { color: #f3f3f3; }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255, 255, 255, 0.08); }
.theme-toggle .icon-theme { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: flex; }
[data-theme="dark"] .theme-toggle .icon-sun { display: flex; }
.theme-toggle svg { width: 18px; height: 18px; }
.taskbar-clock {
  text-align: right;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 4px;
  min-width: 4.5rem;
  transition: color 0.45s ease;
}
[data-theme="light"] .taskbar-clock { color: #1c1c1c; }
[data-theme="dark"] .taskbar-clock { color: #f3f3f3; }
.taskbar-time { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }
.taskbar-date {
  font-size: 11px;
  font-weight: 400;
  margin-top: 1px;
  transition: color 0.45s ease;
}
[data-theme="light"] .taskbar-date { color: #444; }
[data-theme="dark"] .taskbar-date { color: rgba(255, 255, 255, 0.72); }

/* Меню «Пуск» (Windows 11) */
.start-host {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 48px;
  z-index: 9;
  pointer-events: none;
}

.start-host.is-open {
  pointer-events: auto;
  /* Выше окна раздела (11), чтобы плитки «Пуск» всегда получали клик */
  z-index: 14;
}

.start-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: none;
  padding: 0;
  margin: 0;
  display: block;
  cursor: default;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.start-host.is-open .start-scrim {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  /* без backdrop-filter — фон рабочего стола не размывается */
}

[data-theme="light"] .start-host.is-open .start-scrim {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .start-host.is-open .start-scrim {
  background: rgba(0, 0, 0, 0.15);
}

.start-menu {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: auto;
  min-width: min(360px, calc(100vw - 20px));
  max-width: min(720px, calc(100vw - 16px));
  box-sizing: border-box;
  border-radius: 12px;
  overflow: hidden;
  z-index: 2;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.06),
    0 16px 48px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 12px) scale(0.98);
  opacity: 0;
  transform-origin: bottom center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
}

[data-theme="light"] .start-menu {
  background: rgba(243, 243, 243, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(48px) saturate(1.35);
  backdrop-filter: blur(48px) saturate(1.35);
}

[data-theme="dark"] .start-menu {
  background: rgba(36, 36, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(56px) saturate(1.25);
  backdrop-filter: blur(56px) saturate(1.25);
}

.start-host.is-open .start-menu {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.start-menu-inner {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 800px);
  padding: 8px 8px 6px;
  box-sizing: border-box;
}

.start-menu-inner--patient .start-menu-nav {
  flex: 1 1 auto;
  min-height: 88px;
}

.start-menu-inner--patient .start-menu-list:empty {
  min-height: 0;
  margin: 0;
  padding: 0;
}

.start-menu-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  margin: 2px 2px 10px;
  border-radius: 8px;
  box-sizing: border-box;
}

[data-theme="light"] .start-menu-search {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .start-menu-search {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.start-menu-search-icon {
  display: flex;
  flex-shrink: 0;
  opacity: 0.85;
}

.start-menu-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  outline: none;
  cursor: default;
}

[data-theme="light"] .start-menu-search-input {
  color: #1a1a1a;
}

[data-theme="light"] .start-menu-search-input::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .start-menu-search-input {
  color: #fafafa;
}

[data-theme="dark"] .start-menu-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.start-menu-search-input:disabled {
  opacity: 0.75;
}

.start-menu-tool-hits-wrap {
  margin: 0 0 10px;
  flex-shrink: 0;
}

.start-menu-tool-hits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.start-menu-tool-hit-li {
  margin: 0;
  padding: 0;
}

.start-menu-tool-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

[data-theme="light"] .start-menu-tool-hit {
  background: rgba(255, 255, 255, 0.42);
  color: #1a1a1a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .start-menu-tool-hit {
  background: rgba(255, 255, 255, 0.06);
  color: #fafafa;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .start-menu-tool-hit:hover {
  background: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .start-menu-tool-hit:hover {
  background: rgba(255, 255, 255, 0.1);
}

.start-menu-tool-hit:focus-visible {
  outline: 2px solid rgba(0, 120, 212, 0.85);
  outline-offset: 1px;
}

.start-menu-tool-hit-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-menu-tool-hit-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.start-menu-tool-hit-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.start-menu-tool-hit-title {
  line-height: 1.25;
  word-break: break-word;
}

.start-menu-tool-hit-hub {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.72;
}

.start-menu-no-results {
  margin: 0;
  padding: 14px 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

[data-theme="light"] .start-menu-no-results {
  color: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .start-menu-no-results {
  color: rgba(255, 255, 255, 0.6);
}

.start-menu-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 2px 4px;
}

.start-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(118px, auto);
  gap: 4px;
  align-items: stretch;
}

@media (min-width: 520px) {
  .start-menu-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(112px, auto);
  }
}

@media (min-width: 640px) {
  .start-menu-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: minmax(106px, auto);
  }
}

@media (min-width: 760px) {
  .start-menu-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: minmax(98px, auto);
  }
}

@media (min-width: 920px) {
  .start-menu-list {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* Десктоп: плотнее плитки и шире панель — все разделы помещаются без прокрутки на типичном экране */
@media (min-width: 769px) {
  .start-menu {
    max-width: min(980px, calc(100vw - 16px));
  }

  .start-menu-inner {
    max-height: min(90vh, 840px);
  }

  .start-menu-search {
    min-height: 44px;
    height: 44px;
    padding: 0 10px;
    margin: 1px 1px 6px;
  }

  .start-menu-search-input {
    font-size: 14px;
  }

  .start-menu-list {
    gap: 2px;
    grid-auto-rows: minmax(90px, auto);
  }

  .start-menu-tile {
    padding: 7px 3px 5px;
    gap: 4px;
    justify-content: flex-start;
  }

  .start-menu-tile-iconbox {
    width: 62px;
    height: 62px;
    border-radius: 9px;
  }

  .start-menu-tile-img {
    width: 40px;
    height: 40px;
  }

  .start-menu-tile-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    min-height: 0;
    flex: 1 1 auto;
  }

  .start-menu-tile-wrap {
    min-height: 0;
  }

  .start-menu-footer {
    padding: 7px 6px 5px;
    margin-top: 4px;
  }
}

@media (min-width: 920px) {
  .start-menu-list {
    grid-auto-rows: minmax(84px, auto);
  }

  .start-menu-tile-label {
    font-size: 10.5px;
    font-weight: 500;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

.start-menu-tile-wrap {
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: transparent;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Сетка задаёт плиткам display:flex — без этого атрибут hidden может не убирать ячейку из сетки */
.start-menu-list > .start-menu-tile-wrap[hidden] {
  display: none !important;
}

[data-theme="light"] .start-menu-tile-wrap:hover {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .start-menu-tile-wrap:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.start-menu-tile {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px 8px;
  margin: 0;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 400;
  cursor: default;
  box-sizing: border-box;
  background: transparent;
  transition: color 0.12s ease;
}

[data-theme="light"] .start-menu-tile {
  color: #1a1a1a;
}

[data-theme="dark"] .start-menu-tile {
  color: #fafafa;
}

/* Явный цвет подписей: в тёмной теме наследование с ссылок иногда даёт тёмный текст на тёмном фоне */
[data-theme="dark"] .start-menu-tile-label {
  color: #f3f4f6;
}

[data-theme="light"] .start-menu-tile-label {
  color: #1a1a1a;
}

[data-theme="dark"] a.start-menu-tile.start-menu-tile--link,
[data-theme="dark"] a.start-menu-tile.start-menu-tile--link:visited {
  color: #f3f4f6;
}

[data-theme="light"] a.start-menu-tile.start-menu-tile--link,
[data-theme="light"] a.start-menu-tile.start-menu-tile--link:visited {
  color: #1a1a1a;
}

a.start-menu-tile.start-menu-tile--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a.start-menu-tile.start-menu-tile--link:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 2px;
}

.start-menu-tile-iconbox {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Подложки плиток в сетке «Пуск»: единая рамка, тень и скругление; пастельный градиент по разделу (как «Антибиотики» / «Гастроэнтерология») */
[data-theme="light"] .start-menu-list .start-menu-tile-iconbox {
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 1px 3px rgba(0, 0, 0, 0.07);
  background: linear-gradient(155deg, #f1f2f6 0%, #e4e6ee 100%);
}

[data-theme="dark"] .start-menu-list .start-menu-tile-iconbox {
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
}

/* Единый визуальный размер глифа во всех плитках «Пуск» */
.start-menu-tile-img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.start-menu-list .start-menu-tile-img {
  filter: drop-shadow(0 0.5px 0.8px rgba(0, 0, 0, 0.14));
}

[data-theme="dark"] .start-menu-list .start-menu-tile-img {
  filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.45));
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox {
  /* Как у «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #f7edf9 44%, #dec0e8 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(92, 72, 102, 0.9) 0%, rgba(58, 48, 72, 0.93) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(22%) sepia(28%) saturate(780%) hue-rotate(268deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(72%) sepia(12%) saturate(450%) hue-rotate(268deg) brightness(0.88)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox {
  /* Внешняя площадка как у «Анестезиологии» (лавандовый пастель) */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

/* Внутренняя «карточка» с градиентом (как у глифа анестезиологии) + меньший масштаб иконки */
[data-theme="light"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #e8faf0 45%, #c8efd9 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(88, 102, 94, 0.88) 0%, rgba(56, 72, 64, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  /* Тёмно-зелёный силуэт вместо чистого чёрного, ближе к стилю анестезиологии */
  filter: brightness(0) saturate(100%) invert(22%) sepia(12%) saturate(1200%) hue-rotate(95deg) brightness(0.95)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(72%) sepia(8%) saturate(400%) hue-rotate(95deg) brightness(0.85)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="analysis"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e8eaf6 0%, #d6dbf5 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="analysis"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(40, 48, 85, 0.52) 0%, rgba(25, 30, 55, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="anesthesia"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="anesthesia"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="antibiotics"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e8eaf6 0%, #d4daf6 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="antibiotics"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(45, 50, 85, 0.5) 0%, rgba(28, 32, 58, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox {
  /* Как у «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #fff6eb 42%, #ffd4a8 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(118, 88, 62, 0.88) 0%, rgba(78, 58, 42, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(28%) sepia(72%) saturate(900%) hue-rotate(2deg) brightness(0.92)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(72%) sepia(22%) saturate(480%) hue-rotate(2deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="article_generator"] .start-menu-tile-iconbox {
  /* Как у «Аллергологии» / «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="article_generator"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="article_generator"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #f3edfa 45%, #dfd0f0 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="article_generator"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(92, 76, 108, 0.88) 0%, rgba(62, 50, 82, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="article_generator"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(22%) sepia(28%) saturate(750%) hue-rotate(235deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="article_generator"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(72%) sepia(14%) saturate(480%) hue-rotate(235deg) brightness(0.88)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="article_rewrite"] .start-menu-tile-iconbox {
  /* Как у «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="article_rewrite"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="article_rewrite"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #fff5f8 42%, #f0c8dc 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="article_rewrite"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(108, 74, 88, 0.88) 0%, rgba(72, 48, 58, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="article_rewrite"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(24%) sepia(22%) saturate(900%) hue-rotate(310deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="article_rewrite"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(74%) sepia(12%) saturate(420%) hue-rotate(310deg) brightness(0.88)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="brainstorm"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #fefef9 0%, #f7f2e4 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="brainstorm"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(68, 62, 48, 0.34) 0%, rgba(42, 40, 32, 0.54) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="cardiology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #ffebee 0%, #ffd6dc 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="cardiology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(78, 32, 40, 0.48) 0%, rgba(48, 20, 28, 0.68) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox {
  /* Как у «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #eefaf9 44%, #b8e4de 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(58, 98, 94, 0.88) 0%, rgba(36, 68, 64, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(26%) sepia(18%) saturate(700%) hue-rotate(165deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(72%) sepia(10%) saturate(350%) hue-rotate(165deg) brightness(0.88)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox {
  /* Как у «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #f2f5f8 45%, #d8e0e8 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(88, 94, 104, 0.88) 0%, rgba(56, 62, 72, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(26%) sepia(8%) saturate(600%) hue-rotate(175deg) brightness(0.92)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(70%) sepia(6%) saturate(300%) hue-rotate(175deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="drug_registry"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e8f5e9 0%, #cee8d0 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="drug_registry"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(28, 65, 38, 0.5) 0%, rgba(16, 45, 28, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="endocrinology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #fffdfb 0%, #f8f0e6 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="endocrinology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(72, 62, 48, 0.36) 0%, rgba(46, 40, 32, 0.56) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="ent"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #f1f8e9 0%, #dcecc0 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="ent"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(48, 62, 28, 0.5) 0%, rgba(30, 42, 18, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="gastroenterology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #fffde7 0%, #fff9c4 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="gastroenterology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(82, 68, 22, 0.48) 0%, rgba(52, 42, 14, 0.68) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox {
  /* Как у «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #fef2f7 44%, #eab8cf 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(102, 62, 80, 0.88) 0%, rgba(68, 44, 58, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(24%) sepia(24%) saturate(880%) hue-rotate(305deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(73%) sepia(11%) saturate(400%) hue-rotate(305deg) brightness(0.88)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="lab"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e0f7fa 0%, #c5eff5 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="lab"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(25, 70, 78, 0.5) 0%, rgba(15, 48, 55, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="mkb_classifier"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #f3e5f5 0%, #e6d4ef 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="mkb_classifier"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(62, 38, 72, 0.5) 0%, rgba(38, 22, 48, 0.68) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="nephrology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e0f7fa 0%, #b8ecf0 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="nephrology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(22, 72, 78, 0.5) 0%, rgba(14, 48, 52, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="neurology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e8eaf6 0%, #d2d7f2 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="neurology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(42, 48, 82, 0.5) 0%, rgba(26, 30, 55, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="obgyn"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #fce4ec 0%, #f8d8ea 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="obgyn"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(72, 38, 58, 0.48) 0%, rgba(45, 24, 38, 0.68) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="pediatrics"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e1f5fe 0%, #c8ecfc 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="pediatrics"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(22, 62, 88, 0.5) 0%, rgba(14, 42, 62, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="rheumatology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #efebe9 0%, #e0d6d2 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="rheumatology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(58, 48, 44, 0.5) 0%, rgba(38, 32, 28, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="suggestion"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #fffbf8 0%, #f7ebe3 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="suggestion"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(72, 58, 48, 0.36) 0%, rgba(46, 38, 34, 0.56) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="urology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #e3f2fd 0%, #cfe9fc 100%);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="urology"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(22, 58, 92, 0.5) 0%, rgba(14, 38, 62, 0.7) 100%);
}
[data-theme="light"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox {
  /* Как у «Аллергологии» / «Анестезиологии»: лавандовая внешняя площадка */
  background: linear-gradient(155deg, #faf5ff 0%, #ede2fc 100%);
  position: relative;
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%);
  position: relative;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 45%, #c8daf5 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(82, 96, 118, 0.88) 0%, rgba(48, 60, 82, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-img {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(24%) sepia(18%) saturate(900%) hue-rotate(185deg) brightness(0.92)
    contrast(1.05) drop-shadow(0 0.5px 0.6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-img {
  filter: brightness(0) saturate(100%) invert(72%) sepia(10%) saturate(400%) hue-rotate(185deg) brightness(0.9)
    contrast(1.05) drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.35));
}

/* WebP-плитки с встроенным градиентом: brightness(0) даёт чёрный квадрат — показываем файл как есть */
.start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox::before,
.start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox::before,
.start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox::before,
.start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox::before,
.start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox::before,
.start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox::before,
.start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox::before {
  content: none !important;
  display: none !important;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, #f1f2f6 0%, #e4e6ee 100%) !important;
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-iconbox,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-iconbox,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-iconbox,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-iconbox,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-iconbox,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-iconbox,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-iconbox {
  background: linear-gradient(155deg, rgba(56, 58, 68, 0.95) 0%, rgba(38, 40, 48, 0.98) 100%) !important;
}

.start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-img,
.start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-img,
.start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-img,
.start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-img,
.start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-img,
.start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-img,
.start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-img {
  width: 40px !important;
  height: 40px !important;
}

[data-theme="light"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-img,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-img,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-img,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-img,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-img,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-img,
[data-theme="light"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-img {
  filter: drop-shadow(0 0.5px 0.8px rgba(0, 0, 0, 0.14)) !important;
}

[data-theme="dark"] .start-menu-tile-wrap[data-section-id="admin"] .start-menu-tile-img,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="allergology"] .start-menu-tile-img,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="appointment_calendar"] .start-menu-tile-img,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="dicom_viewer"] .start-menu-tile-img,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="documents"] .start-menu-tile-img,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="infectious"] .start-menu-tile-img,
[data-theme="dark"] .start-menu-tile-wrap[data-section-id="user_guide"] .start-menu-tile-img {
  filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.45)) !important;
}

.start-menu-tile-label {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: break-word;
  word-break: normal;
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  display: block;
}

/* Мобильная панель задач: «Пуск» у левого края; меню «Пуск» — у левого края; мельче подписи плиток */
@media (max-width: 768px) {
  .taskbar:not(.taskbar--lockscreen) {
    grid-template-columns: auto 1fr;
    padding: 0 6px 0 4px;
  }

  .taskbar:not(.taskbar--lockscreen) .taskbar-leading {
    display: none;
  }

  .taskbar:not(.taskbar--lockscreen) .taskbar-center {
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
  }

  .taskbar:not(.taskbar--lockscreen) .taskbar-tray {
    justify-self: end;
  }

  .start-menu {
    left: 8px;
    right: auto;
    width: min(360px, calc(100vw - 16px));
    max-width: min(720px, calc(100vw - 16px));
    transform: translate(0, 12px) scale(0.98);
    transform-origin: bottom left;
  }

  .start-host.is-open .start-menu {
    transform: translate(0, 0) scale(1);
  }

  /* Меню «Пуск» на телефоне: плотнее, ровные ряды, без вертикального скролла */
  .start-menu-inner {
    max-height: calc(100dvh - 54px - env(safe-area-inset-bottom, 0px));
    padding: 5px 5px 4px;
  }

  .start-menu-search {
    padding: 5px 8px;
    margin: 0 1px 6px;
    gap: 8px;
  }

  .start-menu-search-input {
    font-size: 13px;
  }

  .start-menu-nav {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 1px 2px;
  }

  .start-menu-list {
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
    gap: 3px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(96px, auto);
    align-content: start;
  }

  .start-menu-tile-wrap {
    min-height: 0;
    overflow: hidden;
  }

  .start-menu-tile {
    justify-content: flex-start;
    padding: 5px 2px 4px;
    gap: 3px;
  }

  .start-menu-tile-iconbox {
    width: 62px;
    height: 62px;
    border-radius: 8px;
  }

  .start-menu-tile-img {
    width: 40px;
    height: 40px;
  }

  .start-menu-tile-label {
    font-size: 10.5px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
    min-height: 0;
  }

  .start-menu-footer {
    padding: 6px 6px 5px;
    margin-top: 3px;
    gap: 8px;
  }

  .start-menu-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .start-menu-user-name {
    font-size: 12.5px;
  }
}

[data-theme="light"] .start-menu-tile:disabled {
  opacity: 1;
}

[data-theme="dark"] .start-menu-tile:disabled {
  opacity: 1;
}

/* События мыши доходят до li с draggable — иначе disabled-кнопка и её потомки блокируют drag */
.start-menu-tile:disabled,
.start-menu-tile:disabled * {
  pointer-events: none;
}

.start-menu-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px 6px;
  margin-top: 6px;
  border-top-width: 1px;
  border-top-style: solid;
}

[data-theme="light"] .start-menu-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .start-menu-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.start-menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  border: none;
  padding: 4px 8px;
  margin: -4px -4px -4px -8px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.start-menu-user:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .start-menu-user:hover {
  background: rgba(255, 255, 255, 0.08);
}

.start-menu-user:focus-visible {
  outline: 2px solid #0067c0;
  outline-offset: 2px;
}

.start-menu-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}

.start-menu-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.start-menu-user-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

[data-theme="light"] .start-menu-user-avatar {
  background: linear-gradient(145deg, #0067c0, #42a5f5);
  color: #fff;
}

[data-theme="dark"] .start-menu-user-avatar {
  background: linear-gradient(145deg, #0078d4, #60cdff);
  color: #1a1a1a;
}

.start-menu-user-name {
  font-size: 14px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="light"] .start-menu-user-name {
  color: #1a1a1a;
}

[data-theme="dark"] .start-menu-user-name {
  color: #fafafa;
}

.start-menu-form {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.start-menu-form--power {
  margin: 0;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.12s ease, color 0.2s ease;
}

[data-theme="light"] .start-menu-item {
  color: #1a1a1a;
}

[data-theme="light"] .start-menu-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .start-menu-item {
  color: #fafafa;
}

[data-theme="dark"] .start-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.start-menu-item:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 0;
}

.start-menu-item-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.start-menu-item-icon svg {
  width: 20px;
  height: 20px;
}

.start-menu-item-label {
  flex: 1;
  min-width: 0;
}

.start-menu-item--power {
  width: 40px;
  height: 40px;
  max-width: none;
  min-height: 0;
  padding: 0;
  margin: 0;
  justify-content: center;
  gap: 0;
  border-radius: 8px;
}

.start-menu-item--power .start-menu-item-icon {
  width: 26px;
  height: 26px;
}

.start-menu-item--power .start-menu-item-icon svg {
  width: 22px;
  height: 22px;
}

/* Панель чата в стиле виджетов Windows 11 (справа, поверх рабочего стола) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.widgets-host {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 48px;
  /* Выше окна раздела (11), чтобы панель чата и «Закрыть» работали при открытом разделе */
  z-index: 12;
  pointer-events: none;
}

.widgets-host.is-open {
  pointer-events: auto;
}

.widgets-scrim {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  display: block;
  cursor: default;
  background: transparent;
  opacity: 0;
  transition: opacity 0.28s ease, backdrop-filter 0.28s ease, -webkit-backdrop-filter 0.28s ease;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  pointer-events: none;
}

.widgets-host.is-open .widgets-scrim {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  backdrop-filter: blur(24px) saturate(1.15);
}

[data-theme="light"] .widgets-host.is-open .widgets-scrim {
  background: rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .widgets-host.is-open .widgets-scrim {
  background: rgba(0, 0, 0, 0.45);
}

.widgets-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 94vw);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 12px));
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 12px 0 0 12px;
  overflow: hidden;
  z-index: 1;
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.22);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
}

[data-theme="light"] .widgets-panel {
  background: rgba(252, 252, 252, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-right: none;
  -webkit-backdrop-filter: blur(48px) saturate(1.25);
  backdrop-filter: blur(48px) saturate(1.25);
}

[data-theme="dark"] .widgets-panel {
  background: rgba(44, 44, 44, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
  -webkit-backdrop-filter: blur(48px) saturate(1.2);
  backdrop-filter: blur(48px) saturate(1.2);
}

.widgets-host.is-open .widgets-panel {
  transform: translateX(0);
}

.widgets-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 12px 12px 20px;
  flex-shrink: 0;
}

.widgets-panel-title-wrap {
  min-width: 0;
}

.widgets-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

[data-theme="light"] .widgets-panel-title { color: #1a1a1a; }
[data-theme="dark"] .widgets-panel-title { color: #fafafa; }

.widgets-panel-sub {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
}

[data-theme="light"] .widgets-panel-sub { color: rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .widgets-panel-sub { color: rgba(255, 255, 255, 0.6); }

.widgets-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.2s ease;
}

[data-theme="light"] .widgets-close {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .widgets-close:hover {
  background: rgba(0, 0, 0, 0.09);
}

[data-theme="dark"] .widgets-close {
  color: #f3f3f3;
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .widgets-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.widgets-close:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

.widgets-close svg {
  width: 16px;
  height: 16px;
}

.widgets-chat-error {
  margin: 0 16px 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}

[data-theme="light"] .widgets-chat-error {
  background: rgba(196, 43, 28, 0.12);
  color: #8b1a12;
}

[data-theme="dark"] .widgets-chat-error {
  background: rgba(255, 99, 71, 0.15);
  color: #ffb4a8;
}

.widgets-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widgets-msg {
  padding: 10px 12px;
  border-radius: 10px;
  max-width: 100%;
  box-sizing: border-box;
}

[data-theme="light"] .widgets-msg {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .widgets-msg {
  background: rgba(255, 255, 255, 0.06);
}

.widgets-msg--mine {
  align-self: flex-end;
  margin-left: 24px;
}

[data-theme="light"] .widgets-msg--mine {
  background: rgba(0, 103, 192, 0.1);
}

[data-theme="dark"] .widgets-msg--mine {
  background: rgba(96, 205, 255, 0.12);
}

/* Сообщения администратора — заметный градиент (в т.ч. для «моих», если вы админ) */
[data-theme="light"] .widgets-msg--admin {
  background: linear-gradient(
    125deg,
    rgba(118, 56, 200, 0.22) 0%,
    rgba(0, 120, 212, 0.18) 45%,
    rgba(0, 150, 136, 0.16) 100%
  );
  border: 1px solid rgba(90, 60, 180, 0.28);
  box-shadow: 0 2px 10px rgba(0, 103, 192, 0.1);
}

[data-theme="dark"] .widgets-msg--admin {
  background: linear-gradient(
    125deg,
    rgba(170, 110, 255, 0.28) 0%,
    rgba(50, 130, 240, 0.22) 50%,
    rgba(0, 200, 180, 0.14) 100%
  );
  border: 1px solid rgba(180, 140, 255, 0.35);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.widgets-msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
}

.widgets-msg-delete {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  opacity: 0.75;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

[data-theme="light"] .widgets-msg-delete:hover {
  background: rgba(196, 43, 28, 0.12);
  opacity: 1;
}

[data-theme="dark"] .widgets-msg-delete:hover {
  background: rgba(255, 99, 71, 0.18);
  opacity: 1;
}

.widgets-msg-delete:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
  opacity: 1;
}

[data-theme="light"] .widgets-msg-meta { color: rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .widgets-msg-meta { color: rgba(255, 255, 255, 0.55); }

.widgets-msg-user {
  font-weight: 600;
}

.widgets-msg-time {
  font-weight: 400;
  opacity: 0.9;
}

.widgets-msg-body {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="light"] .widgets-msg-body { color: #1a1a1a; }
[data-theme="dark"] .widgets-msg-body { color: #f0f0f0; }

.widgets-msg-footer {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.widgets-msg--mine .widgets-msg-footer {
  justify-content: flex-end;
}

.widgets-msg-reply-preview {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 6px;
  padding: 6px 8px 6px 10px;
  border-radius: 8px;
  border-left: 3px solid #0067c0;
  opacity: 0.95;
}

[data-theme="light"] .widgets-msg-reply-preview {
  background: rgba(0, 103, 192, 0.08);
  color: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .widgets-msg-reply-preview {
  background: rgba(96, 205, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  border-left-color: #60cdff;
}

.widgets-msg-reply-preview-user {
  font-weight: 600;
  margin-right: 4px;
}

.widgets-msg-reply-preview-text {
  opacity: 0.9;
}

.widgets-msg-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 28px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.75;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.widgets-msg-reply-label {
  line-height: 1.2;
}

[data-theme="light"] .widgets-msg-reply:hover {
  background: rgba(0, 103, 192, 0.1);
  opacity: 1;
}

[data-theme="dark"] .widgets-msg-reply:hover {
  background: rgba(96, 205, 255, 0.14);
  opacity: 1;
}

.widgets-msg-reply:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
  opacity: 1;
}

.widgets-msg--highlight {
  animation: widgets-msg-highlight-pulse 0.9s ease-out 2;
}

@keyframes widgets-msg-highlight-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.55); }
  100% { box-shadow: 0 0 0 12px rgba(0, 120, 212, 0); }
}

.widgets-chat-reply-bar {
  font-size: 12px;
  line-height: 1.35;
  border-radius: 8px;
  padding: 8px 10px;
}

[data-theme="light"] .widgets-chat-reply-bar {
  background: rgba(0, 103, 192, 0.08);
  color: #1a1a1a;
}

[data-theme="dark"] .widgets-chat-reply-bar {
  background: rgba(96, 205, 255, 0.1);
  color: #f0f0f0;
}

.widgets-chat-reply-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widgets-chat-reply-bar-label {
  font-weight: 600;
  flex-shrink: 0;
  opacity: 0.85;
}

.widgets-chat-reply-bar-snippet {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.widgets-chat-reply-bar-cancel {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  background: transparent;
  opacity: 0.7;
}

.widgets-chat-reply-bar-cancel:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .widgets-chat-reply-bar-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.widgets-compose {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top-width: 1px;
  border-top-style: solid;
}

[data-theme="light"] .widgets-compose {
  border-top-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .widgets-compose {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.widgets-input {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid transparent;
}

[data-theme="light"] .widgets-input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}

[data-theme="dark"] .widgets-input {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fafafa;
}

.widgets-input:focus {
  outline: none;
  border-color: #0067c0;
  box-shadow: 0 0 0 2px rgba(0, 103, 192, 0.2);
}

[data-theme="dark"] .widgets-input:focus {
  border-color: #60cdff;
  box-shadow: 0 0 0 2px rgba(96, 205, 255, 0.2);
}

.widgets-send {
  align-self: flex-end;
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: #0067c0;
  transition: background 0.15s ease;
}

.widgets-send:hover {
  background: #005a9e;
}

[data-theme="dark"] .widgets-send {
  background: #60cdff;
  color: #1a1a1a;
}

[data-theme="dark"] .widgets-send:hover {
  background: #4cc2f7;
}

.taskbar-chat-btn,
.taskbar-help-btn,
.taskbar-appt-cal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.45s ease, background-color 0.2s ease;
}

.taskbar-chat-btn:focus-visible,
.taskbar-help-btn:focus-visible,
.taskbar-appt-cal-btn:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

[data-theme="light"] .taskbar-chat-btn,
[data-theme="light"] .taskbar-help-btn,
[data-theme="light"] .taskbar-appt-cal-btn { color: #1c1c1c; }
[data-theme="light"] .taskbar-chat-btn:hover,
[data-theme="light"] .taskbar-help-btn:hover,
[data-theme="light"] .taskbar-appt-cal-btn:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] .taskbar-chat-btn,
[data-theme="dark"] .taskbar-help-btn,
[data-theme="dark"] .taskbar-appt-cal-btn { color: #f3f3f3; }
[data-theme="dark"] .taskbar-chat-btn:hover,
[data-theme="dark"] .taskbar-help-btn:hover,
[data-theme="dark"] .taskbar-appt-cal-btn:hover { background: rgba(255, 255, 255, 0.08); }

.taskbar-chat-btn.is-active {
  background: rgba(0, 103, 192, 0.14);
}

[data-theme="dark"] .taskbar-chat-btn.is-active {
  background: rgba(96, 205, 255, 0.16);
}

.taskbar-chat-btn svg,
.taskbar-help-btn svg,
.taskbar-appt-cal-btn svg {
  width: 20px;
  height: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-layer { transition-duration: 0.01ms; }
  .taskbar, .taskbar-clock, .taskbar-date, .theme-toggle, .taskbar-chat-btn, .taskbar-dm-btn, .taskbar-help-btn, .taskbar-appt-cal-btn, .taskbar-start-btn { transition-duration: 0.01ms; }
  .widgets-scrim,
  .widgets-panel,
  .start-scrim,
  .start-menu,
  .start-menu-tile-wrap {
    transition-duration: 0.01ms;
  }
}

/* Личные сообщения (друзья, 1:1) */
.taskbar-dm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: color 0.45s ease, background-color 0.2s ease;
}

.taskbar-dm-btn-icon {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.taskbar-dm-btn-glow {
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: radial-gradient(circle, rgba(196, 43, 28, 0.4) 0%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.taskbar-dm-btn--alert .taskbar-dm-btn-glow {
  opacity: 1;
  animation: taskbar-dm-glow-pulse 1.5s ease-in-out infinite;
}

.taskbar-dm-btn--alert .taskbar-dm-btn-icon {
  color: #c42b1c;
  filter: drop-shadow(0 0 2px rgba(196, 43, 28, 0.45));
  animation: taskbar-dm-icon-pulse 1.5s ease-in-out infinite;
}

.taskbar-dm-btn--alert.is-active {
  background: rgba(196, 43, 28, 0.12);
}

[data-theme="dark"] .taskbar-dm-btn--alert.is-active {
  background: rgba(196, 43, 28, 0.22);
}

@keyframes taskbar-dm-glow-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.95; }
}

@keyframes taskbar-dm-icon-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.88; }
}

@media (prefers-reduced-motion: reduce) {
  .taskbar-dm-btn--alert .taskbar-dm-btn-glow,
  .taskbar-dm-btn--alert .taskbar-dm-btn-icon {
    animation: none;
  }
  .taskbar-dm-btn--alert .taskbar-dm-btn-glow {
    opacity: 0.75;
  }
}

[data-theme="light"] .taskbar-dm-btn { color: #1c1c1c; }
[data-theme="light"] .taskbar-dm-btn:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] .taskbar-dm-btn { color: #f3f3f3; }
[data-theme="dark"] .taskbar-dm-btn:hover { background: rgba(255, 255, 255, 0.08); }
.taskbar-dm-btn.is-active:not(.taskbar-dm-btn--alert) { background: rgba(0, 103, 192, 0.14); }
[data-theme="dark"] .taskbar-dm-btn.is-active:not(.taskbar-dm-btn--alert) { background: rgba(96, 205, 255, 0.16); }

.taskbar-dm-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 2;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  background: #c42b1c;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  animation: taskbar-dm-badge-pulse 1.5s ease-in-out infinite;
}

.taskbar-dm-btn--alert .taskbar-dm-badge {
  animation: taskbar-dm-badge-pulse 1.2s ease-in-out infinite;
}

@keyframes taskbar-dm-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .taskbar-dm-btn--alert .taskbar-dm-badge {
    animation: none;
  }
}

/* Личный чат поверх общего при двух открытых панелях */
.widgets-host--dm.is-open {
  z-index: 13;
}

.widgets-host--global-chat.is-open {
  z-index: 12;
}

/* Личные сообщения — плавающее окно Win11 */
.dm-window-host,
.widgets-host.dm-window-host.is-open {
  position: fixed;
  inset: 0;
  z-index: 13;
  pointer-events: none;
}

.dm-window-host.is-open,
.widgets-host.dm-window-host.is-open {
  pointer-events: none;
}

.dm-window-host.is-open .dm-window-slot,
.dm-window-host.is-open .dm-window-scrim {
  pointer-events: auto;
}

.dm-window-host.dm-window-host--minimized .dm-window-scrim,
.dm-window-host.dm-window-host--minimized .dm-window-slot {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.dm-window-host.dm-window-host--minimized {
  pointer-events: none !important;
}

.dm-window-scrim {
  position: fixed;
  inset: 0;
  bottom: 48px;
  z-index: 0;
  border: none;
  padding: 0;
  margin: 0;
}

/* Личный чат: без размытия рабочего стола (как меню «Пуск») */
.dm-window-host.is-open .dm-window-scrim {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: transparent;
  cursor: default;
}

.dm-window-slot {
  position: fixed;
  left: 50%;
  top: calc((100vh - 48px) / 2);
  right: auto;
  width: min(420px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 96px));
  transform: translate(-50%, -50%);
  z-index: 10;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

/* Закрыто по умолчанию — окно не показывается после входа в систему */
.dm-window-slot[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.dm-window-host:not(.is-open) .dm-window-slot {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.dm-window-host:not(.is-open) .dm-window-scrim {
  display: none;
}

.dm-window-host.is-open .dm-window-slot:not([hidden]) {
  display: block;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

.dm-window-host.dm-window-host--placed .dm-window-slot {
  right: auto;
  transform: none;
}

.dm-window {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: inherit;
}

.dm-window .w11-titlebar {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  min-height: 32px;
  cursor: default;
}

.dm-window .w11-titlebar-leading {
  cursor: move;
  flex: 1 1 auto;
  min-width: 0;
}

.dm-window .w11-titlebar-controls {
  display: flex;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.dm-window .w11-titlebar-btn {
  position: relative;
  z-index: 21;
  pointer-events: auto;
  touch-action: manipulation;
}

.dm-window .w11-titlebar-btn svg {
  pointer-events: none;
}

.dm-window .w11-titlebar-text {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 400;
}

.dm-window-host--maximized .dm-window-slot {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 48px !important;
  width: auto !important;
  height: auto !important;
  margin: 0;
  padding: 0;
}

.dm-window-host--maximized .dm-window {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 8px 8px 0 0;
}

.dm-window-host--maximized .dm-window-scrim {
  bottom: 48px;
}

.dm-window-client {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.dm-window-client button,
.dm-window-client input,
.dm-window-client textarea {
  font-family: inherit;
  font-size: inherit;
}

.dm-window-sub {
  margin: 0;
  padding: 10px 16px 0;
  font-size: 12px;
  line-height: 1.35;
  flex-shrink: 0;
}

[data-theme="light"] .dm-window-sub { color: rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .dm-window-sub { color: rgba(255, 255, 255, 0.6); }

.w11-titlebar-appicon--svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}

.w11-titlebar-appicon--svg svg {
  width: 16px;
  height: 16px;
  display: block;
}

.dm-window-host .dm-view-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dm-window-host .dm-view:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dm-window-host .dm-view[hidden],
#dmViewFriends[hidden],
#dmViewRequests[hidden],
#dmViewAdd[hidden],
#dmViewChat[hidden] {
  display: none !important;
}

.dm-window-host .dm-view-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 12px 12px;
  -webkit-overflow-scrolling: touch;
}

.dm-window-host .widgets-dm-nav {
  flex-shrink: 0;
}

.dm-window-host .widgets-dm-nav[hidden] {
  display: none !important;
}

.dm-window-host .widgets-dm-list--friends {
  flex: 1;
  min-height: 0;
}

.dm-window-error {
  flex-shrink: 0;
  margin: 0 12px 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.dm-window-error[hidden] {
  display: none !important;
}

[data-theme="light"] .dm-window-error {
  background: rgba(196, 43, 28, 0.1);
  color: #a4262c;
}

[data-theme="dark"] .dm-window-error {
  background: rgba(255, 100, 90, 0.14);
  color: #ff9a94;
}

.dm-section {
  margin: 0 0 16px;
}

.dm-section:last-child {
  margin-bottom: 0;
}

.dm-section-title {
  margin: 0 0 8px;
  padding: 10px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
  opacity: 0.72;
}

.dm-section:first-child .dm-section-title {
  padding-top: 2px;
}

.dm-section + .dm-section {
  padding-top: 12px;
  border-top: 1px solid rgba(128, 128, 128, 0.22);
}

.dm-view-hint {
  margin: 0;
  padding: 4px 12px 10px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.78;
}

.dm-field-label {
  display: block;
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.dm-view-add {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: 4px;
}

.dm-view-add-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 12px;
}

/* Позиция при открытом общем чате — в JS (syncDmWindowForChat) */

.taskbar-dm-btn.taskbar-dm-btn--window-open,
.taskbar-dm-btn.taskbar-dm-btn--call-active {
  background: rgba(0, 103, 192, 0.14);
}

.taskbar-dm-btn.taskbar-dm-btn--minimized {
  background: rgba(0, 103, 192, 0.2);
  box-shadow: inset 0 -2px 0 #0078d4;
}

[data-theme="dark"] .taskbar-dm-btn.taskbar-dm-btn--window-open,
[data-theme="dark"] .taskbar-dm-btn.taskbar-dm-btn--call-active {
  background: rgba(96, 205, 255, 0.16);
}

[data-theme="dark"] .taskbar-dm-btn.taskbar-dm-btn--minimized {
  background: rgba(96, 205, 255, 0.22);
  box-shadow: inset 0 -2px 0 #60cdff;
}

/* Уведомления Windows 11 */
.w11-toast-host {
  position: fixed;
  right: 16px;
  bottom: 56px;
  z-index: 10045;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
  max-width: min(400px, calc(100vw - 24px));
  pointer-events: none;
}

.w11-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px 12px;
  width: min(380px, calc(100vw - 24px));
  padding: 12px 36px 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.08);
  animation: w11-toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

.w11-toast--out {
  animation: w11-toast-out 0.22s ease forwards;
}

@keyframes w11-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes w11-toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

[data-theme="light"] .w11-toast {
  background: rgba(252, 252, 252, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  backdrop-filter: blur(40px) saturate(1.2);
  color: #1a1a1a;
}

[data-theme="dark"] .w11-toast {
  background: rgba(43, 43, 43, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(40px) saturate(1.15);
  backdrop-filter: blur(40px) saturate(1.15);
  color: #f5f5f5;
}

.w11-toast-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #60cdff 0%, #0078d4 100%);
  border-radius: 8px 0 0 8px;
}

.w11-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border-radius: 6px;
  background: rgba(0, 120, 212, 0.12);
  color: #0078d4;
  flex-shrink: 0;
}

[data-theme="dark"] .w11-toast-icon {
  background: rgba(96, 205, 255, 0.14);
  color: #60cdff;
}

.w11-toast-icon svg {
  width: 18px;
  height: 18px;
}

.w11-toast-body {
  min-width: 0;
  padding-right: 0;
}

.w11-toast-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.w11-toast-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.88;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.w11-toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  color: inherit;
  opacity: 0.6;
  flex-shrink: 0;
}

.w11-toast-close:hover {
  opacity: 1;
  background: rgba(128, 128, 128, 0.15);
}

.widgets-dm-nav {
  display: flex;
  gap: 4px;
  padding: 10px 12px 12px;
  flex-shrink: 0;
}

.widgets-dm-nav-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  color: inherit;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

[data-theme="light"] .widgets-dm-nav-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .widgets-dm-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.widgets-dm-nav-btn.is-active {
  background: rgba(0, 103, 192, 0.14);
  border-color: rgba(0, 103, 192, 0.35);
  font-weight: 600;
}

[data-theme="dark"] .widgets-dm-nav-btn.is-active {
  background: rgba(96, 205, 255, 0.16);
  border-color: rgba(96, 205, 255, 0.4);
}

.widgets-dm-list {
  padding: 0;
}

.widgets-dm-list--friends {
  overflow-y: auto;
  padding: 0 0 4px;
  min-height: 0;
}

.widgets-dm-list--section {
  overflow: visible;
  min-height: 0;
}

.widgets-dm-friend-row {
  width: 100%;
  margin-bottom: 6px;
}

.widgets-dm-friend-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  background: rgba(128, 128, 128, 0.08);
  font-family: inherit;
  color: inherit;
}

.widgets-dm-friend-open:hover { background: rgba(128, 128, 128, 0.16); }

.widgets-dm-friend-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.widgets-dm-friend-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.widgets-dm-friend-remove {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
}
.widgets-dm-friend-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.widgets-dm-presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.widgets-dm-presence-dot--on {
  background: #1faa1f;
  box-shadow: 0 0 0 2px rgba(31, 170, 31, 0.28);
}

.widgets-dm-presence-dot--off {
  background: #8a8a8a;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .widgets-dm-presence-dot--off {
  background: #6b6b6b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.widgets-dm-presence-text {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 2px;
}

.widgets-dm-presence-text--on {
  color: #0e7a0e;
  font-weight: 600;
}

[data-theme="dark"] .widgets-dm-presence-text--on {
  color: #6ee76e;
}

.widgets-dm-presence-text--off {
  opacity: 0.78;
}

.widgets-dm-friend-presence {
  margin-bottom: 2px;
}

.widgets-dm-friend-name { font-weight: 600; font-size: 14px; }
.widgets-dm-friend-role { font-size: 11px; opacity: 0.75; }
.widgets-dm-friend-preview { font-size: 12px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.widgets-dm-friend-unread {
  flex-shrink: 0;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #c42b1c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.widgets-dm-empty {
  font-size: 13px;
  opacity: 0.75;
  padding: 6px 2px 10px;
  margin: 0;
  line-height: 1.4;
}
.widgets-dm-request-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(128, 128, 128, 0.08);
  font-size: 13px;
}

.widgets-dm-btn-sm {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 103, 192, 0.5);
  background: rgba(0, 103, 192, 0.1);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  font-family: inherit;
  color: inherit;
}

.widgets-dm-btn-sm--muted {
  border-color: rgba(128, 128, 128, 0.4);
  background: transparent;
}

[data-theme="dark"] .widgets-dm-btn-sm {
  color: #f3f3f3;
}

[data-theme="dark"] .widgets-dm-btn-sm--muted,
[data-theme="dark"] .widgets-dm-friend-remove {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .widgets-dm-btn-sm--muted:hover,
[data-theme="dark"] .widgets-dm-friend-remove:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}
.widgets-dm-pending { font-size: 11px; opacity: 0.7; }

.widgets-dm-add-row {
  display: flex;
  gap: 8px;
  padding: 0 12px 8px;
  align-items: stretch;
}

.widgets-dm-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  box-sizing: border-box;
}

.widgets-dm-lookup {
  padding: 0 12px 8px;
  font-size: 13px;
  line-height: 1.4;
  min-height: 1.4em;
}

.widgets-dm-add-friend {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 16px;
  line-height: 1.2;
}

.dm-view-add-footer {
  padding: 0 12px 12px;
}

.widgets-dm-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 8px;
}

.widgets-dm-back {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.widgets-dm-chat-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widgets-dm-chat-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widgets-dm-chat-presence {
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widgets-dm-chat-presence.widgets-dm-presence-text--on {
  color: #0e7a0e;
  font-weight: 600;
}

[data-theme="dark"] .widgets-dm-chat-presence.widgets-dm-presence-text--on {
  color: #6ee76e;
}

.widgets-dm-chat-presence.widgets-dm-presence-text--off {
  opacity: 0.78;
}

.widgets-dm-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 103, 192, 0.12);
  color: #0078d4;
  cursor: pointer;
}

.widgets-dm-call-btn:hover {
  background: rgba(0, 103, 192, 0.2);
}

.widgets-dm-call-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

[data-theme="dark"] .widgets-dm-call-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .widgets-dm-call-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

#dmViewChat.dm-view--chat:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dm-call-host {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dm-call-host[hidden] { display: none !important; }

.dm-call-host:not([hidden]) {
  pointer-events: auto;
}

.dm-call-host:not(.dm-call-host--maximized):not(.dm-call-host--minimized) {
  background: rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .dm-call-host:not(.dm-call-host--maximized):not(.dm-call-host--minimized) {
  background: rgba(0, 0, 0, 0.45);
}

.dm-call-host.dm-call-host--minimized {
  background: transparent;
  pointer-events: none;
}

.dm-call-host.dm-call-host--minimized .dm-call-window-slot {
  visibility: hidden;
  pointer-events: none;
}

.dm-call-host--maximized {
  align-items: stretch;
  justify-content: stretch;
  background: transparent;
}

.dm-call-window-slot {
  width: min(720px, 92vw);
  height: min(520px, calc(100vh - 96px));
  pointer-events: auto;
}

.dm-call-host--maximized .dm-call-window-slot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 48px;
  width: auto;
  height: auto;
}

.dm-call-window {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: inherit;
}

.dm-call-window .w11-titlebar {
  position: relative;
  z-index: 20;
}

.dm-call-window .w11-titlebar-btn svg {
  pointer-events: none;
}

.dm-call-client {
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  min-height: 0;
  flex: 1;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.dm-call-status {
  margin: 0 0 10px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(0, 103, 192, 0.1);
}

.dm-call-status[hidden] {
  display: none !important;
}

[data-theme="dark"] .dm-call-status {
  background: rgba(96, 205, 255, 0.12);
}

.dm-call-videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  align-content: stretch;
}

.dm-call-tile {
  position: relative;
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0d0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dm-call-tile-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  margin: 0;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  pointer-events: none;
  z-index: 2;
}

.dm-call-video {
  width: 100%;
  height: 100%;
  min-height: 160px;
  flex: 1;
  background: #0d0d0d;
  object-fit: cover;
  display: block;
}

.dm-call-video--waiting {
  background: #1a1a1a
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.5'%3E%3Cpath d='M16 16v1a2 2 0 01-2 2H6a2 2 0 01-2-2V7a2 2 0 012-2h2m10 0V5a2 2 0 00-2-2H8a2 2 0 00-2 2v1m10 0h2a2 2 0 012 2v7a2 2 0 01-2 2h-2'/%3E%3C/svg%3E")
    center / 48px no-repeat;
}

.dm-call-host--maximized .dm-call-videos {
  min-height: 0;
}

.dm-call-toolbar {
  flex-shrink: 0;
  margin-top: 12px;
}

.dm-call-leave {
  width: 100%;
  height: 40px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  background: #c42b1c !important;
  border: none;
}

.dm-call-leave:hover {
  filter: brightness(1.05);
}

@media (max-width: 640px) {
  .dm-call-videos {
    grid-template-columns: 1fr;
  }
}

/* Входящий видеозвонок — Win11 acrylic dialog */
.dm-incoming-call {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  pointer-events: none;
}

.dm-incoming-call[hidden] { display: none !important; }

.dm-incoming-call:not([hidden]) {
  pointer-events: auto;
}

.dm-incoming-call-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: dm-incoming-scrim-in 0.28s ease;
}

@keyframes dm-incoming-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dm-incoming-call-card {
  position: relative;
  z-index: 1;
  width: min(400px, calc(100vw - 32px));
  padding: 20px 20px 18px;
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.1);
  animation: dm-incoming-card-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dm-incoming-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

[data-theme="light"] .dm-incoming-call-card {
  background: rgba(252, 252, 252, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: blur(48px) saturate(1.25);
  backdrop-filter: blur(48px) saturate(1.25);
  color: #1a1a1a;
}

[data-theme="dark"] .dm-incoming-call-card {
  background: rgba(43, 43, 43, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(48px) saturate(1.2);
  backdrop-filter: blur(48px) saturate(1.2);
  color: #f5f5f5;
}

.dm-incoming-call-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #60cdff 0%, #0078d4 100%);
  border-radius: 12px 0 0 12px;
}

.dm-incoming-call-dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.dm-incoming-call-dismiss svg {
  width: 10px;
  height: 10px;
}

.dm-incoming-call-dismiss:hover {
  opacity: 1;
  background: rgba(128, 128, 128, 0.18);
}

.dm-incoming-call-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  align-items: center;
  padding: 4px 28px 0 8px;
}

.dm-incoming-call-icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.dm-incoming-call-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 120, 212, 0.2);
  animation: dm-incoming-pulse 2s ease-out infinite;
}

.dm-incoming-call-pulse--delay {
  animation-delay: 0.65s;
}

@keyframes dm-incoming-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.dm-incoming-call-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 120, 212, 0.14);
  color: #0078d4;
}

[data-theme="dark"] .dm-incoming-call-icon {
  background: rgba(96, 205, 255, 0.16);
  color: #60cdff;
}

.dm-incoming-call-icon svg {
  width: 26px;
  height: 26px;
}

.dm-incoming-call-text {
  min-width: 0;
}

.dm-incoming-call-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.72;
  line-height: 1.3;
}

.dm-incoming-call-who {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.dm-incoming-call-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.78;
}

.dm-incoming-call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

[data-theme="dark"] .dm-incoming-call-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.dm-incoming-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.dm-incoming-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dm-incoming-btn:active {
  transform: scale(0.98);
}

.dm-incoming-btn--decline {
  background: rgba(196, 43, 28, 0.12);
  color: #c42b1c;
}

.dm-incoming-btn--decline:hover {
  background: rgba(196, 43, 28, 0.2);
}

[data-theme="dark"] .dm-incoming-btn--decline {
  background: rgba(255, 100, 88, 0.16);
  color: #ff6458;
}

[data-theme="dark"] .dm-incoming-btn--decline:hover {
  background: rgba(255, 100, 88, 0.26);
}

.dm-incoming-btn--accept {
  background: linear-gradient(180deg, #13a10e 0%, #107c10 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 124, 16, 0.35);
}

.dm-incoming-btn--accept:hover {
  filter: brightness(1.06);
}

.dm-incoming-btn--accept:focus-visible,
.dm-incoming-btn--decline:focus-visible,
.dm-incoming-call-dismiss:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 2px;
}
