/*
  Витрина депо. Тёмно-синяя палитра и «чертёжная» подача взяты из приложения
  один в один (values/colors.xml и values-night/colors.xml), чтобы человек,
  открывший сайт после приложения, не почувствовал разницы.

  Вёрстка вертикальная и только под телефон: витриной пользуются с телефона
  в депо, и колоночная раскладка под широкий экран здесь была бы работой
  ради работы. На планшете и мониторе страница просто держит ширину телефона
  по центру.
*/

:root {
  --bg:            #0A1929;
  --surface:       #0D1B2A;
  --surface-2:     #102437;
  --surface-3:     #16304a;
  --line:          rgba(255, 255, 255, .10);
  --line-strong:   rgba(255, 255, 255, .20);
  --text:          #EAF4FF;
  --muted:         #90A4AE;
  --accent:        #00E5FF;
  --accent-2:      #64B5F6;

  --green:  #4CAF50;
  --orange: #FF9800;
  --red:    #F44336;
  --blue:   #2196F3;
  --amber:  #FFC107;
  --purple: #9C27B0;
  --teal:   #009688;
  --pink:   #E91E63;

  --mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: 14px;
  --radius: 16px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

.muted { color: var(--muted); }
.mono  { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ==================== Вход ==================== */

#gate {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
/*
  Обязательное правило, а не перестраховка. Браузерное [hidden]{display:none}
  имеет специфичность 0,1,0 и проигрывает нашему #gate{display:flex} — без
  этой строки ворота остаются на экране даже после gate.hidden = true, и
  журнал грузится под ними, невидимый.
*/
#gate[hidden], #stack[hidden] { display: none !important; }
.gate-box { width: 100%; max-width: 340px; text-align: center; }
.gate-mark {
  font-family: var(--mono); font-size: 44px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); text-shadow: 0 0 24px rgba(0, 229, 255, .6); margin-bottom: 10px;
}
.gate-box h1 { font-size: 20px; margin-bottom: 6px; }
.gate-box p { font-size: 13px; margin-bottom: 22px; }
#gateToken {
  width: 100%; padding: 14px; margin-bottom: 12px;
  font-family: var(--mono); font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  outline: none;
}
#gateToken:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 229, 255, .12); }
.btn-primary {
  width: 100%; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, #0f4c75, #1976D2);
  color: #fff; font-weight: 600; letter-spacing: .04em;
  box-shadow: 0 6px 20px rgba(25, 118, 210, .35);
}
.btn-primary:active { transform: translateY(1px); }
.gate-error { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--red); }

/* ==================== Стопка экранов ==================== */

#stack { position: fixed; inset: 0; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
/* Экраны поверх главной приезжают снизу с лёгким «доводом» и уезжают обратно. */
.screen.sub {
  transform: translateY(100%);
  opacity: 0;
  transition: transform .38s cubic-bezier(.22, .8, .28, 1), opacity .22s ease;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, .55);
}
.screen.sub.shown { transform: translateY(0); opacity: 1; }
/* Экран, ушедший под верхний: слегка отъезжает и гаснет — «глубина» стопки. */
.screen.buried { transform: scale(.93) translateY(-2%); opacity: .35; filter: blur(1px); }
.screen.buried, .screen.home { transition: transform .38s cubic-bezier(.22, .8, .28, 1), opacity .3s ease, filter .3s ease; }

.screen-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 var(--pad) calc(28px + var(--bottom));
  scrollbar-width: none;
}
.screen-body::-webkit-scrollbar { display: none; }

/* ==================== Верхняя панель ==================== */

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--top)) var(--pad) 10px;
  background: linear-gradient(180deg, rgba(10, 25, 41, .98), rgba(10, 25, 41, .82));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: relative; z-index: 2;
}
.topbar .back {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 18px; line-height: 1; color: var(--accent-2);
}
.topbar .back:active { background: var(--surface-3); }
.topbar .titles { min-width: 0; flex: 1; }
.topbar h2 { font-size: 16px; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ==================== Главная карусель ==================== */

.home-head {
  padding: calc(14px + var(--top)) var(--pad) 8px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.home-head .brand {
  font-family: var(--mono); font-size: 19px; font-weight: 700; letter-spacing: .16em;
  color: var(--text); text-shadow: 0 0 18px rgba(0, 229, 255, .35);
}
.home-head .brand span { color: var(--accent); }
.home-head .stamp { font-size: 10px; color: var(--muted); letter-spacing: .14em; text-align: right; }

.carousel {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  padding: 0 var(--pad);
  scrollbar-width: none;
  perspective: 1000px;
}
.carousel::-webkit-scrollbar { display: none; }
/* Отступы-«пустышки» не нужны: карусель бесконечная, сверху и снизу от любой
   карточки всегда есть соседние. */
.carousel { padding-top: 0; padding-bottom: 0; }

.tile {
  scroll-snap-align: center;
  position: relative;
  margin: 10px 0;
  padding: 20px 18px;
  min-height: 168px;
  display: flex; flex-direction: column; justify-content: space-between;
  border-radius: 20px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .07), transparent 60%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  overflow: hidden;
  /* Масштаб и яркость ведёт скрипт по расстоянию до центра — та же логика,
     что у карусели тепловозов на главном экране приложения. */
  transform: scale(var(--k, .9));
  opacity: var(--a, .5);
  transition: transform .18s linear, opacity .18s linear, box-shadow .3s ease;
  will-change: transform, opacity;
}
.tile.center {
  border-color: rgba(0, 229, 255, .38);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 229, 255, .12), 0 0 34px rgba(0, 229, 255, .1);
}
.tile:active { filter: brightness(1.12); }

/* Тонкая «сетка чертежа» на карточке. */
.tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(200deg, #000, transparent 70%);
}

.tile-top { display: flex; align-items: flex-start; gap: 12px; position: relative; }
.tile-top .grow { flex: 1; min-width: 0; padding-right: 26px; }
.tile-glyph {
  width: 46px; height: 46px; flex: none; border-radius: 13px;
  display: grid; place-items: center; font-size: 22px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
}
.tile h3 { font-size: 19px; letter-spacing: .01em; }
.tile .tile-sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.tile .tile-index {
  position: absolute; right: 0; top: -2px;
  font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em;
}
.tile-foot { display: flex; gap: 16px; align-items: flex-end; position: relative; margin-top: 16px; }
.tile-stat .v { font-family: var(--mono); font-size: 20px; font-weight: 700; line-height: 1; }
.tile-stat .l { font-size: 10px; color: var(--muted); margin-top: 5px; letter-spacing: .06em; text-transform: uppercase; }
.tile-spark { flex: 1; height: 34px; align-self: center; }

/* ==================== Карточки контента ==================== */

.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}
.card > .card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 14px; letter-spacing: .02em; }
.card-head .hint { font-size: 11px; color: var(--muted); }
.card-head .more { font-size: 11px; color: var(--accent); letter-spacing: .04em; }

.section-title {
  margin: 22px 0 2px; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}

/* Показатели в ряд. */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.kpis.two { grid-template-columns: repeat(2, 1fr); }
.kpi {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 10px;
}
.kpi .v { font-family: var(--mono); font-size: 19px; font-weight: 700; line-height: 1.1; }
.kpi .l { font-size: 10px; color: var(--muted); margin-top: 5px; letter-spacing: .04em; }

/* ==================== Фильтры ==================== */

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.chip.on { background: rgba(0, 229, 255, .12); border-color: rgba(0, 229, 255, .5); color: var(--accent); }

/* ==================== Списки ==================== */

.list { margin-top: 10px; }
.row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; margin-top: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
}
.row:active { background: var(--surface-3); }
.row .grow { min-width: 0; flex: 1; }
.row .t { font-size: 13.5px; line-height: 1.35; }
.row .s { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.row .num { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.row .thumb {
  width: 54px; height: 54px; flex: none; border-radius: 10px; object-fit: cover;
  background: var(--surface-3); border: 1px solid var(--line);
}
.row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.row.done .t { color: var(--muted); text-decoration: line-through; }

.tag {
  display: inline-block; padding: 2px 7px; border-radius: 6px;
  font-size: 10px; letter-spacing: .04em; border: 1px solid currentColor; opacity: .95;
}

.empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 13px; }

/* ==================== Карусель тепловозов ==================== */

.loco-rail {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 0 12px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none;
}
.loco-rail::-webkit-scrollbar { display: none; }
.loco-rail::before, .loco-rail::after { content: ""; flex: none; width: calc(var(--pad) - 12px + 12px); }

.loco-card {
  scroll-snap-align: center; flex: none;
  width: 78vw; max-width: 320px;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.loco-card.center {
  border-color: rgba(0, 229, 255, .4);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5), 0 0 26px rgba(0, 229, 255, .09);
}
.loco-photo {
  width: 100%; height: 148px; object-fit: cover; display: block;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
}
.loco-photo.ph { display: grid; place-items: center; font-size: 42px; opacity: .35; }
.loco-body { padding: 12px 14px 14px; }
.loco-num { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: .04em; }
.loco-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.loco-mini { display: flex; gap: 14px; margin-top: 12px; }
.loco-mini .v { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.loco-mini .l { font-size: 9.5px; color: var(--muted); margin-top: 3px; letter-spacing: .05em; text-transform: uppercase; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; display: block; }

/* ==================== Фотографии ==================== */

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.thumbs img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px;
  background: var(--surface-3); border: 1px solid var(--line);
}
.hero-photo {
  width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad));
  height: 210px; object-fit: cover; display: block;
}

#viewer {
  position: fixed; inset: 0; z-index: 80; background: rgba(2, 8, 15, .96);
  display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s ease;
}
#viewer.on { display: flex; opacity: 1; }
#viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
#viewer .close {
  position: absolute; top: calc(12px + var(--top)); right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); display: grid; place-items: center; font-size: 18px;
}

/* ==================== График ремонтов ==================== */

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.cal-nav button { padding: 8px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 16px; }
.cal-nav .m { font-size: 14px; letter-spacing: .04em; }

.cal-wrap { overflow-x: auto; margin-top: 12px; scrollbar-width: none; }
.cal-wrap::-webkit-scrollbar { display: none; }
.cal { border-collapse: separate; border-spacing: 2px; font-size: 10px; }
.cal th { font-weight: 500; color: var(--muted); font-size: 9px; padding: 0 0 4px; }
.cal th.loco-col, .cal td.loco-col {
  position: sticky; left: 0; z-index: 1; background: var(--bg);
  text-align: left; padding-right: 8px; font-family: var(--mono); font-size: 11px;
}
.cal td.day {
  /* min-width, а не width: таблица иначе ужимает клетки до нечитаемых
     четырнадцати точек, лишь бы влезть в экран целиком. Пусть лучше едет вбок. */
  min-width: 23px; height: 24px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid transparent;
  vertical-align: middle; text-align: center;
}
.cal td.day.weekend { background: rgba(255, 255, 255, .02); }
.cal td.day.today { border-color: var(--accent); }
.cal .cell-dots { display: flex; gap: 1.5px; justify-content: center; flex-wrap: wrap; line-height: 0; }
.cal .cell-dots i { width: 4px; height: 4px; border-radius: 50%; display: block; }
.cal .plan-label { font-size: 7.5px; color: var(--orange); font-family: var(--mono); }
.cal th.now { color: var(--accent); }
.cal td.loco-col em { display: block; font-style: normal; font-size: 8.5px; color: var(--muted); }

/* Стоянка по маяку — полоска по низу клетки; часы подписаны только там, где
   клетка достаточно крупная (широкий режим), иначе цифра нечитаема. */
.cal td.day { position: relative; padding-bottom: 6px; }
.cal .stay {
  position: absolute; left: 1px; right: 1px; bottom: 1px; height: 5px;
  border-radius: 2px; display: flex; align-items: center; justify-content: center;
}
.cal .stay span { display: none; font-family: var(--mono); font-size: 7px; color: #08131f; font-weight: 700; }

/* Полоса «выполнение графика» — план против факта по маяку. */
.plan-bar { margin-top: 14px; }
.plan-bar .pb-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.plan-bar .track { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.plan-bar .fill { height: 100%; border-radius: 4px; transition: width .7s cubic-bezier(.22, .8, .28, 1); }
.plan-bar .pb-sub { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ==================== График во весь экран ==================== */

.cal-nav .wide-btn { font-size: 15px; padding: 8px 12px; }

#wide { position: fixed; inset: 0; z-index: 95; background: var(--bg); overflow: hidden; }
#wide .wide-inner { width: 100%; height: 100%; display: flex; flex-direction: column; }
#wide .wide-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none;
}
#wide .wide-head button {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; font-size: 15px;
}
#wide .wide-body { flex: 1; overflow: auto; padding: 10px 14px 16px; scrollbar-width: none; }
#wide .wide-body::-webkit-scrollbar { display: none; }
#wide .cal { font-size: 11px; }
#wide .cal td.day { min-width: 34px; height: 38px; padding-bottom: 9px; }
#wide .cal .plan-label { font-size: 10px; }
#wide .cal .stay { height: 9px; }
#wide .cal .stay span { display: block; }
#wide .cal td.loco-col, #wide .cal th.loco-col { font-size: 12px; background: var(--bg); }

/* Система не дала альбомную ориентацию — разворачиваем сетку сами: месяц
   читается только вдоль длинной стороны экрана. */
#wide.rot .wide-inner {
  /* Меняем стороны местами и кладём сетку набок: сдвиг в процентах — от
     высоты самого блока (она равна ширине экрана), в vh промахивается. */
  width: 100vh; height: 100vw;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: top left;
}

/* ==================== Разбор дня ==================== */

#daySheet {
  position: fixed; inset: 0; z-index: 96; display: flex; align-items: flex-end;
  background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s ease;
}
#daySheet.on { opacity: 1; }
#daySheet .ds-card {
  width: 100%; max-height: 86vh; overflow: auto; scrollbar-width: none;
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 10px 18px calc(22px + var(--bottom));
  transform: translateY(18px); transition: transform .25s cubic-bezier(.22, .8, .28, 1);
}
#daySheet.on .ds-card { transform: none; }
#daySheet .ds-card::-webkit-scrollbar { display: none; }
#daySheet .ds-grip {
  width: 36px; height: 4px; border-radius: 3px; margin: 0 auto 12px;
  background: rgba(255, 255, 255, .28);
}
#daySheet h3 { font-size: 17px; margin: 0; }
#daySheet .ds-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
#daySheet .ds-match {
  margin-top: 12px; padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
}
#daySheet .verdict { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
#daySheet .ml { display: flex; gap: 10px; padding: 2px 0; font-size: 12px; }
#daySheet .ml .l { width: 104px; flex: none; color: var(--muted); }
#daySheet .ml .v { flex: 1; }
#daySheet .ds-list { margin-top: 6px; }
#daySheet .ds-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
#daySheet .ds-row:last-child { border-bottom: none; }
#daySheet .ds-row.past { opacity: .72; }
#daySheet .ds-row i { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; }
#daySheet .ds-row .t { flex: 1; min-width: 0; }
#daySheet .ds-row .c { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#daySheet .ds-row .x { font-size: 13px; margin-top: 2px; }
#daySheet .ds-row .s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
#daySheet .ds-row .time { font-size: 11px; color: var(--muted); flex: none; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }

/* ==================== Табло последних замен ==================== */

.bars-rail {
  display: flex; gap: 8px; align-items: flex-end; overflow-x: auto;
  padding: 10px 0 6px; height: 190px; scrollbar-width: none;
}
.bars-rail::-webkit-scrollbar { display: none; }
.bar-col { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-col .bar {
  width: 26px; border-radius: 6px 6px 2px 2px; min-height: 4px;
  transition: height .5s cubic-bezier(.22, .8, .28, 1);
  box-shadow: 0 0 14px rgba(0, 0, 0, .4) inset;
}
.bar-col .days { font-family: var(--mono); font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.bar-col .who { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; }

/* ==================== Диаграммы ==================== */

.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 9px; font-family: var(--mono); }
.chart .bar-rect { transition: height .6s cubic-bezier(.22, .8, .28, 1), y .6s cubic-bezier(.22, .8, .28, 1); }

.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-wrap svg { flex: none; }
.donut-center { font-family: var(--mono); fill: var(--text); }
.donut-legend { flex: 1; min-width: 0; font-size: 11.5px; }
.donut-legend .li { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.donut-legend .li i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-legend .li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .li .p { font-family: var(--mono); color: var(--muted); }

/* Горизонтальные полосы «топ по значению». */
.hbars { margin-top: 4px; }
.hbar { padding: 7px 0; }
.hbar .hb-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.hbar .hb-top .v { font-family: var(--mono); color: var(--muted); }
.hbar .track { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; width: 0; transition: width .7s cubic-bezier(.22, .8, .28, 1); }

/* ==================== Прочее ==================== */

.toast {
  position: fixed; left: 50%; bottom: calc(26px + var(--bottom)); transform: translate(-50%, 20px);
  z-index: 90; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  background: rgba(16, 36, 55, .96); border: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ==================== Пульс депо (Радар смены) ==================== */

.pulse-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(0, 229, 255, .14), transparent 65%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid rgba(0, 229, 255, .28);
  margin-top: 12px;
}
.pulse-ring { position: relative; width: 92px; height: 92px; flex: none; }
.pulse-ring svg { display: block; width: 100%; height: 100%; }
.pulse-ring .pr-val {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-family: var(--mono);
}
.pulse-ring .pr-num { font-size: 22px; font-weight: 700; line-height: 1; }
.pulse-ring .pr-lbl { font-size: 9px; color: var(--muted); margin-top: 4px; letter-spacing: .08em; text-transform: uppercase; }
.pulse-meta { flex: 1; min-width: 0; }
.pulse-meta h3 { font-size: 16px; margin: 0 0 4px; }
.pulse-meta .pm-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pulse-btn {
  width: 100%; margin-top: 12px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, .4);
  background: linear-gradient(135deg, rgba(0, 229, 255, .18), rgba(41, 121, 255, .14));
  color: var(--text); font-weight: 600; font-size: 13.5px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
}
.pulse-btn:active { filter: brightness(1.18); transform: scale(.99); }

.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* Появление содержимого экрана «лесенкой»: элементы всплывают по очереди. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise > * { animation: rise .38s cubic-bezier(.22, .8, .28, 1) backwards; }
.rise > *:nth-child(1) { animation-delay: .02s; }
.rise > *:nth-child(2) { animation-delay: .06s; }
.rise > *:nth-child(3) { animation-delay: .10s; }
.rise > *:nth-child(4) { animation-delay: .14s; }
.rise > *:nth-child(5) { animation-delay: .18s; }
.rise > *:nth-child(6) { animation-delay: .22s; }
.rise > *:nth-child(7) { animation-delay: .26s; }
.rise > *:nth-child(8) { animation-delay: .30s; }
.rise > *:nth-child(n + 9) { animation-delay: .34s; }

@media (prefers-reduced-motion: reduce) {
  .rise > *, .screen.sub, .tile { animation: none !important; transition: none !important; }
}

/* На широком экране витрина остаётся телефоном по центру: раскладка под
   монитор здесь не нужна никому, а поддерживать пришлось бы вторую вёрстку. */
