/* Док LDS OS: вид «Air soft», который стоял до 24.10 (отдельные полупрозрачные клавиши без общей обоймы, подпись
   мелким капсом, тонкая линия под рядом, оранжевая черта у открытых), чуть меньше (Алекс 24.10: «верни тот, который был,
   и сделай поменьше»). Поведение - спека 2.4: не прячется никогда,
   разделитель перед «Всё», вылет активной плитки, бейдж с числом. Плитки «Дом» нет: рабочий стол и есть Дом. */
.os-dock {
  position: fixed;
  z-index: var(--z-dock, 800);
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  max-width: calc(100vw - 16px);
  -webkit-user-select: none;
  user-select: none;
}
.os-dock__tiles {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  isolation: isolate;
  box-sizing: border-box;
}
/* Тонкая линия под рядом клавиш вместо обоймы */
.os-dock__tiles::before {
  content: '';
  position: absolute;
  left: 8%; right: 8%; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(173, 204, 238, .18) 24%, rgba(173, 204, 238, .18) 76%, transparent);
  opacity: .45;
  pointer-events: none;
}
.os-dock__tile {
  --key-fill: rgba(79, 101, 128, .085);
  --key-stroke: rgba(168, 193, 225, .12);
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 70px;
  height: 42px;
  padding: 0 0 6px;
  border: 0;
  border-radius: 11px;
  isolation: isolate;
  background: transparent;
  color: #a0b3cc;
  font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif);
  cursor: default;
  transition: color .18s ease;
}
.os-dock__key { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.os-dock__key svg { display: block; width: 100%; height: 100%; overflow: visible; }
.os-dock__key path { fill: var(--key-fill); stroke: var(--key-stroke); stroke-width: 1; transition: fill .18s ease, stroke .18s ease; }
.os-dock__tile > svg:not(.os-dock__key svg) {
  position: relative;
  z-index: 1;
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}
.os-dock__label {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  color: #9eafc5;
  font-size: 8px;
  font-weight: 500;
  line-height: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.os-dock__tile:is(:hover, :focus-visible) { --key-fill: rgba(106, 137, 175, .17); --key-stroke: rgba(183, 211, 243, .42); color: #d0e2f8; }
.os-dock__tile.is-active,
.os-dock__tile[aria-expanded="true"] { --key-fill: rgba(111, 142, 179, .20); --key-stroke: rgba(185, 208, 238, .43); color: #d7e8fc; }
.os-dock__tile.is-active .os-dock__label,
.os-dock__tile[aria-expanded="true"] .os-dock__label { color: #dae6f6; }
.os-dock__tile:focus-visible { outline: 2px solid #b3cfff; outline-offset: 3px; }

/* Черта под клавишей всегда видна; оранжевая - у активного и открытых окон, свёрнутое - тише. */
.os-dock__tile::after {
  content: '';
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: .5px;
  width: 37%;
  height: 2px;
  margin-left: -18.5%;
  border-radius: 1px;
  background: rgba(177, 185, 197, .36);
  transition: background .18s ease;
}
.os-dock__tile[data-window-state="open"]::after,
.os-dock__tile.is-active::after { background: #f3ab6e; box-shadow: 0 0 4px rgba(242, 161, 91, .12); }
.os-dock__tile[data-window-state="minimized"]::after { background: rgba(243, 171, 110, .45); }

/* Бейдж: кружок с числом в правом верхнем углу плитки (у активной - у вылета). Красный - просрочено. */
.os-dock__badge {
  position: absolute;
  z-index: 3;
  top: -3px;
  right: 9px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--hot, #ff9d42);
  color: var(--on-hot, #1b1006);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
  pointer-events: none;
}
.os-dock__badge[hidden] { display: none; }
.os-dock__tile.is-active .os-dock__badge { top: -16px; right: 6px; }
.os-dock__badge[data-tone="danger"] { background: var(--danger-fill, #e5484d); color: var(--on-danger, #f4f6f8); }

.os-dock__sep {
  flex: none;
  width: 1px;
  height: 24px;
  margin: 0 1px;
  background: rgba(181, 205, 235, .10);
}

/* Вылет (канон lds-os-liftoff-pattern): иконка поднимается над обоймой, её место в плитке пустеет. */
.os-dock__fly {
  position: absolute;
  z-index: 2;
  top: -10px;
  left: 0;
  width: 28px;
  height: 28px;
  color: #c4d9f0;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(5, 12, 22, .5)) drop-shadow(0 0 4px rgba(158, 195, 240, .09));
  transition: opacity 160ms var(--ease, ease);
}
.os-dock__fly.is-on { opacity: 1; }
.os-dock__fly .fx { position: absolute; inset: 0; display: block; }
.os-dock__fly svg { display: block; width: 100%; height: 100%; stroke-width: 1.5; }
.os-dock__fly .fx-out { animation: os-dock-fx-out 420ms var(--ease, ease) both; }
.os-dock__fly .fx-in { animation: os-dock-fx-in 420ms var(--ease, ease) both; }
@keyframes os-dock-fx-out { 0% { opacity: 1; filter: blur(0); } 45%, 100% { opacity: 0; filter: blur(4px); } }
@keyframes os-dock-fx-in { 0%, 40% { opacity: 0; filter: blur(4px); } 100% { opacity: 1; filter: blur(0); } }
.os-dock__tile.is-active > svg:not(.os-dock__key svg),
.os-dock__tile.is-landing > svg:not(.os-dock__key svg) { visibility: hidden; }

@media (max-width: 500px) {
  .os-dock { left: 8px; right: 8px; transform: none; }
  .os-dock__tiles { gap: 3px; padding-inline: 6px; justify-content: center; }
  .os-dock__tile { flex: 1 1 0; width: auto; min-width: 0; max-width: 62px; }
  .os-dock__label { display: none; }
  .os-dock__badge { right: 4px; }
}

/* Проверка приложения на обычном рабочем столе (&desk=mac): дока LDS OS нет */
body[data-desk="mac"] .os-dock { display: none; }

@media (prefers-reduced-motion: reduce) {
  .os-dock__fly .fx-out, .os-dock__fly .fx-in { animation: none; }
  .os-dock__tile, .os-dock__fly, .os-dock__tile::after, .os-dock__key path { transition: none; }
}
