:root {
  --brand-red: #e31e24;
  --brand-red-dark: #b5161b;
  --ink: #171a1f;
  --muted: #606874;
  --line: #dfe3e8;
  --line-strong: #c9ced6;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --page: #eceff3;
  --shadow-sm: 0 10px 24px rgba(23, 26, 31, 0.08);
  --shadow-md: 0 18px 48px rgba(23, 26, 31, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--page) !important;
  color: var(--ink) !important;
  font-family: "Segoe UI", Arial, sans-serif !important;
}

body.ux-enhanced {
  overflow-x: hidden;
}

body.ux-enhanced #root > div {
  padding-left: 84px;
}

#root > div {
  min-height: 100vh !important;
  background:
    linear-gradient(180deg, rgba(227, 30, 36, 0.06), rgba(227, 30, 36, 0) 240px),
    var(--page) !important;
  color: var(--ink) !important;
  font-family: "Segoe UI", Arial, sans-serif !important;
}

#root > div > div:first-child {
  min-height: 84px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 24px !important;
  padding: 18px 24px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: 0 10px 32px rgba(23, 26, 31, 0.06) !important;
  position: sticky;
  top: 0;
  z-index: 50;
}

#root > div > div:first-child h1 {
  margin: 0 !important;
  color: var(--ink) !important;
  font-size: clamp(24px, 2.6vw, 34px) !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
  font-weight: 800 !important;
}

#root > div > div:first-child h1::before {
  content: "Корпоративный маршрут активности";
  display: block;
  margin-bottom: 7px;
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  word-spacing: 0.18em;
  text-transform: uppercase;
}

#root > div > div:first-child h1 + div {
  min-width: 340px;
  padding: 10px 14px !important;
  color: var(--muted) !important;
  background: var(--surface-soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  align-items: center !important;
  gap: 16px !important;
  text-align: right;
  font-size: 14px !important;
}

#root > div > div:first-child h1 + div::before {
  content: "Цикл " attr(data-cycle) "\AТекущий отрезок";
  white-space: pre-line;
  justify-self: start;
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.06em;
  word-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
}

#root > div > div:nth-child(2) {
  display: grid !important;
  grid-template-columns: minmax(620px, 1fr) 400px !important;
  grid-template-areas:
    "status status"
    "map panel" !important;
  gap: 14px !important;
  padding: 14px !important;
  align-items: start !important;
}

.ux-status-rail {
  grid-area: status;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ux-status-cell {
  min-height: 76px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.ux-status-cell span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ux-status-cell strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ux-status-cell--accent {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  border-color: var(--brand-red-dark);
}

.ux-status-cell--accent span,
.ux-status-cell--accent strong {
  color: #fff;
}

.leaflet-container {
  grid-area: map;
  height: calc(100dvh - 196px) !important;
  min-height: 610px !important;
  width: 100% !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius) !important;
  background: #e7ebf0 !important;
  box-shadow: var(--shadow-md) !important;
  position: relative !important;
  overflow: hidden !important;
}

.leaflet-container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  z-index: 500;
}

.leaflet-control-zoom {
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 12px 32px rgba(23, 26, 31, 0.18) !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  color: var(--ink) !important;
  background: #fff !important;
  transition: background 180ms ease, color 180ms ease !important;
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus-visible {
  color: #fff !important;
  background: var(--brand-red) !important;
}

.leaflet-overlay-pane svg path {
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke;
}

.leaflet-marker-icon div {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.leaflet-marker-icon div[style*="background:#ef4444"],
.leaflet-marker-icon div[style*="background: #ef4444"] {
  background: var(--brand-red) !important;
  box-shadow: 0 0 0 5px rgba(227, 30, 36, 0.14), 0 8px 20px rgba(23, 26, 31, 0.2) !important;
}

.ux-route-card {
  position: absolute;
  left: 18px;
  right: auto;
  bottom: 18px;
  z-index: 650;
  width: min(520px, calc(100% - 36px));
  max-width: 520px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(201, 206, 214, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(23, 26, 31, 0.18);
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.ux-route-card__top,
.ux-route-card__bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ux-route-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.16;
}

.ux-route-card strong {
  color: var(--brand-red);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ux-eyebrow {
  margin: 0 0 6px;
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ux-progress {
  height: 8px;
  margin: 10px 0 8px;
  overflow: hidden;
  background: #e7eaee;
  border-radius: 999px;
}

.ux-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-red), #ff6166);
  border-radius: inherit;
  transition: width 260ms ease;
}

.ux-route-card__bottom span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ux-route-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf0f3;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.ux-route-card__meta b {
  color: var(--ink);
  font-size: 12px !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ux-route-red {
  filter: drop-shadow(0 4px 8px rgba(227, 30, 36, 0.2));
}

.ux-route-current {
  stroke-dasharray: 14 10;
  animation: ux-route-flow 900ms linear infinite;
}

.ux-route-done {
  stroke-dasharray: 1 0;
}

@keyframes ux-route-flow {
  to {
    stroke-dashoffset: -24;
  }
}

.ux-map-note {
  display: none !important;
}

#root > div > div:nth-child(2) > div:last-child {
  grid-area: panel;
  height: calc(100dvh - 196px) !important;
  min-height: 610px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  overflow: hidden !important;
}

#root > div > div:nth-child(2) > div:last-child > div {
  color: var(--ink) !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child {
  order: 99;
  padding: 10px 12px !important;
  background:
    linear-gradient(135deg, rgba(227, 30, 36, 0.07), rgba(255, 255, 255, 0) 62%),
    #ffffff !important;
  border-color: #d9dde4 !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
  transition: max-height 220ms ease, opacity 180ms ease, box-shadow 180ms ease, padding 180ms ease !important;
}

body.ux-hr-revealed #root > div > div:nth-child(2) > div:last-child > div:first-child {
  position: fixed !important;
  top: 112px;
  right: 24px;
  z-index: 1400;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 136px) !important;
  padding: 18px !important;
  opacity: 1;
  pointer-events: auto;
  overflow: auto !important;
  box-shadow: 0 24px 80px rgba(20, 24, 33, 0.24) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child > div,
#root > div > div:nth-child(2) > div:last-child > div:first-child form {
  color: var(--ink) !important;
  background: transparent !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child h3 {
  min-height: 34px;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--ink) !important;
  font-size: 18px !important;
  margin: 0 !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child h3::after {
  content: "Служебный доступ";
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  word-spacing: 0.14em;
  text-transform: uppercase;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child input {
  margin-top: 6px !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child div[style*="color: red"] {
  color: var(--brand-red) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2),
#root > div > div:nth-child(2) > div:last-child > div:last-child {
  padding: 12px 14px !important;
}

.ux-route-timeline {
  display: none !important;
  order: 2;
  flex: 0 1 236px;
  min-height: 186px;
  max-height: 244px;
  padding: 12px 14px !important;
  color: var(--ink) !important;
  background:
    linear-gradient(135deg, rgba(227, 30, 36, 0.08), rgba(255, 255, 255, 0) 58%),
    var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

.ux-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ux-panel-heading span {
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ux-panel-heading strong {
  padding: 5px 8px;
  color: var(--brand-red);
  background: rgba(227, 30, 36, 0.08);
  border: 1px solid rgba(227, 30, 36, 0.16);
  border-radius: 999px;
  font-size: 11px !important;
  line-height: 1;
}

.ux-route-timeline__list {
  display: grid;
  gap: 6px;
  max-height: 188px;
  overflow: auto;
  padding-right: 4px;
}

.ux-route-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
}

.ux-route-step i {
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border: 2px solid #c8ced8;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.08);
}

.ux-route-step strong {
  display: block;
  color: var(--ink);
  font-size: 13px !important;
  line-height: 1.15;
}

.ux-route-step span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ux-route-step--done i {
  border-color: rgba(227, 30, 36, 0.42);
  background: rgba(227, 30, 36, 0.18);
}

.ux-route-step--active i {
  width: 13px;
  height: 13px;
  margin-left: 2px;
  border-color: var(--brand-red);
  background: var(--brand-red);
  box-shadow: 0 0 0 6px rgba(227, 30, 36, 0.14), 0 0 18px rgba(227, 30, 36, 0.35);
}

.ux-route-step--next {
  padding: 5px 8px;
  margin-left: -8px;
  background: #f7f8fa;
  border: 1px solid #edf0f3;
  border-radius: var(--radius);
}

.ux-route-step--next i {
  border-color: var(--brand-red);
}

.ux-activity-hub {
  position: fixed;
  top: 18px;
  bottom: 18px;
  left: 104px;
  z-index: 1250;
  width: min(980px, calc(100vw - 132px));
  padding: 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 90px rgba(23, 26, 31, 0.22);
  overflow: auto;
  transform: translateX(-24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 180ms ease;
}

body.ux-drawer-open .ux-activity-hub {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.ux-left-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  width: 84px;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 36px rgba(23, 26, 31, 0.08);
}

.ux-left-nav__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  color: var(--brand-red);
  background: rgba(227, 30, 36, 0.08);
  border-radius: 999px;
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
}

.ux-left-nav button {
  min-height: 60px !important;
  padding: 9px 6px !important;
  margin: 0 !important;
  color: var(--muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius) !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

.ux-left-nav button svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ux-left-nav button span {
  display: block;
}

.ux-left-nav button:hover,
.ux-left-nav button:focus-visible,
.ux-left-nav button.is-active {
  color: var(--brand-red) !important;
  background: rgba(227, 30, 36, 0.08) !important;
  border-color: rgba(227, 30, 36, 0.14) !important;
}

.ux-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ux-drawer-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.ux-drawer-head button {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 24px !important;
}

.ux-auth-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(227, 30, 36, 0.06), rgba(255, 255, 255, 0) 58%), var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-explain-card,
.ux-quick-user-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-explain-card {
  border-color: rgba(227, 30, 36, 0.18);
  background: linear-gradient(135deg, rgba(227, 30, 36, 0.06), rgba(255, 255, 255, 0) 62%), #fff;
}

.ux-explain-card b,
.ux-quick-user-card strong,
.ux-auth-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.ux-explain-card span,
.ux-quick-user-card small,
.ux-auth-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ux-drawer-view {
  display: none;
}

.ux-drawer-view.is-active {
  display: block;
}

.ux-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ux-overview-grid article,
.ux-route-rules div {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-overview-grid strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.ux-overview-grid span,
.ux-route-rules span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.ux-route-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ux-route-rules b {
  display: block;
  color: var(--brand-red);
  font-size: 13px;
}

.ux-auth-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.ux-auth-grid label,
.ux-activity-create label {
  display: grid;
  gap: 6px;
}

.ux-auth-grid label span,
.ux-activity-create label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ux-activity-hub__head,
.ux-activity-grid,
.ux-activity-form__row,
.ux-activity-create,
.ux-activity-metrics {
  display: grid;
  gap: 10px;
}

.ux-activity-hub__head {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.ux-activity-hub h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.ux-activity-metrics {
  grid-template-columns: repeat(3, minmax(96px, 1fr));
}

.ux-activity-metrics span {
  min-width: 96px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-activity-metrics b,
.ux-leaderboard-row b {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.ux-activity-metrics small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ux-activity-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: start;
}

.ux-activity-form {
  display: grid;
  gap: 10px;
}

.ux-activity-form__row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 0.9fr) minmax(120px, 0.7fr) auto;
  align-items: end;
}

.ux-activity-create {
  grid-template-columns: minmax(160px, 1fr) minmax(130px, 0.8fr) auto;
  align-items: center;
}

.ux-activity-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ux-activity-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ux-activity-note.is-error {
  color: var(--brand-red);
  font-weight: 750;
}

.ux-leaderboard {
  padding: 12px;
  background: linear-gradient(135deg, rgba(227, 30, 36, 0.06), rgba(255, 255, 255, 0) 58%), var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-leaderboard__list {
  display: grid;
  gap: 7px;
}

.ux-leaderboard-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid #edf0f3;
  border-radius: var(--radius);
}

.ux-leaderboard-row i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--brand-red);
  background: rgba(227, 30, 36, 0.08);
  border-radius: 999px;
  font-style: normal;
  font-weight: 850;
}

.ux-leaderboard-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.ux-leaderboard-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ux-user-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.ux-user-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-user-row i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--brand-red);
  background: rgba(227, 30, 36, 0.08);
  border-radius: 999px;
  font-style: normal;
  font-weight: 900;
}

.ux-user-row strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.ux-user-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ux-leader-chart {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ux-leader-bar {
  display: grid;
  grid-template-columns: 160px 1fr 86px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.ux-leader-bar i {
  height: 9px;
  overflow: hidden;
  background: #e7eaee;
  border-radius: 999px;
}

.ux-leader-bar i b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-red), #ff6166);
  border-radius: inherit;
}

.ux-leader-bar strong {
  color: var(--ink);
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ux-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ux-hr-hotspot {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 1200;
  width: 10px !important;
  min-width: 10px !important;
  height: 10px !important;
  min-height: 10px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(227, 30, 36, 0.18) !important;
  box-shadow: none !important;
  opacity: 0.12;
}

.ux-hr-hotspot:hover,
.ux-hr-hotspot:focus-visible {
  opacity: 0.85;
  outline: 3px solid rgba(227, 30, 36, 0.14);
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) {
  order: 1;
  flex: 0 0 auto;
  background:
    linear-gradient(135deg, rgba(227, 30, 36, 0.08), rgba(255, 255, 255, 0) 60%),
    var(--surface) !important;
}

#root > div > div:nth-child(2) > div:last-child h2,
#root > div > div:nth-child(2) > div:last-child h3 {
  margin: 0 0 10px !important;
  color: var(--ink) !important;
  font-size: 20px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

#root > div > div:nth-child(2) > div:last-child h2::before,
#root > div > div:nth-child(2) > div:last-child h3::before {
  display: block;
  margin-bottom: 5px;
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child h3::before {
  content: "Администрирование";
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) h3::before {
  content: "Сводка";
}

#root > div > div:nth-child(2) > div:last-child > div:last-child h2::before {
  content: "Город маршрута";
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) > div {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 7px 0 !important;
  color: var(--muted) !important;
  border-bottom: 1px solid #edf0f3 !important;
}

#root > div > div:nth-child(2) > div:last-child b {
  color: var(--ink) !important;
  font-size: 18px !important;
  font-variant-numeric: tabular-nums;
}

#root > div > div:nth-child(2) > div:last-child hr {
  margin: 8px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) hr,
#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) > div:last-child {
  display: none !important;
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) > hr + div:not(.ux-visited-cities) {
  display: none !important;
}

.ux-visited-cities {
  display: block !important;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) > .ux-visited-cities {
  display: block !important;
}

.ux-visited-cities__list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow: auto;
  padding-right: 4px;
}

.ux-visited-cities .ux-route-step {
  padding: 6px 8px;
  background: rgba(227, 30, 36, 0.045);
  border: 1px solid rgba(227, 30, 36, 0.1);
  border-radius: var(--radius);
}

.ux-visited-cities .ux-route-step strong {
  color: var(--ink) !important;
}

.ux-visited-cities .ux-route-step span {
  color: var(--brand-red) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:last-child {
  order: 3;
  flex: 1 1 150px;
  min-height: 112px;
  overflow-y: auto !important;
}

#root > div > div:nth-child(2) > div:last-child > div:last-child img {
  width: 100% !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:last-child div {
  color: var(--muted) !important;
}

.ux-field-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100% !important;
  min-height: 44px !important;
  color: var(--ink) !important;
  background: #fff !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius) !important;
  padding: 11px 12px !important;
  outline: none !important;
  font: inherit !important;
}

textarea {
  line-height: 1.5 !important;
  resize: vertical !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.14) !important;
}

input[type="file"] {
  padding: 9px !important;
  background: var(--surface-soft) !important;
}

button {
  min-height: 44px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius) !important;
  background: #ffffff !important;
  color: var(--ink) !important;
  font-weight: 750 !important;
  cursor: pointer !important;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease !important;
}

button:hover,
button:focus-visible {
  border-color: var(--brand-red) !important;
}

button:active {
  transform: translateY(1px);
}

button:not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out) {
  margin-top: 8px !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child button:first-of-type,
#root > div > div:nth-child(2) > div:last-child button[style*="background"] {
  border-color: var(--brand-red) !important;
  background: var(--brand-red) !important;
  color: #fff !important;
}

button[aria-label*="Закрыть"],
button[aria-label*="Удалить"] {
  min-width: 44px !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  #root > div > div:nth-child(2) {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "status"
      "map"
      "panel" !important;
  }

  .leaflet-container,
  #root > div > div:nth-child(2) > div:last-child {
    min-height: auto !important;
    height: auto !important;
  }

  .leaflet-container {
    height: 64vh !important;
    min-height: 520px !important;
  }

  #root > div > div:nth-child(2) > div:last-child {
    overflow: visible !important;
  }

  .ux-activity-hub__head,
  .ux-activity-grid,
  .ux-activity-form__row,
  .ux-activity-create {
    grid-template-columns: 1fr;
  }

  .ux-activity-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.ux-enhanced #root > div {
    padding-left: 0;
  }

  .ux-left-nav {
    display: none;
  }

  .ux-activity-hub {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .ux-auth-grid {
    grid-template-columns: 1fr;
  }

  .ux-overview-grid,
  .ux-route-rules,
  .ux-user-list {
    grid-template-columns: 1fr;
  }

  .ux-leader-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #root > div > div:first-child {
    display: block !important;
    padding: 14px !important;
    position: static;
  }

  #root > div > div:first-child h1 {
    font-size: 24px !important;
  }

  #root > div > div:first-child h1 + div {
    min-width: 0;
    margin-top: 10px;
    text-align: left;
  }

  #root > div > div:nth-child(2) {
    padding: 10px !important;
    gap: 10px !important;
  }

  .ux-status-rail {
    grid-template-columns: 1fr 1fr;
  }

  .ux-status-cell {
    min-height: 68px;
    padding: 12px;
  }

  .ux-status-cell strong {
    font-size: 20px;
  }

  .leaflet-container {
    height: 58vh !important;
    min-height: 440px !important;
  }

  .ux-route-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    padding: 12px;
  }

  .ux-route-card__top,
  .ux-route-card__bottom {
    display: block;
  }

  .ux-route-card h2 {
    font-size: 19px;
  }

  .ux-route-card strong {
    display: block;
    margin-top: 8px;
    font-size: 25px;
  }

  .ux-map-note {
    display: none;
  }

  .ux-activity-metrics {
    grid-template-columns: 1fr;
  }
}

/* v3: visible corporate dashboard layer, ASCII escaped labels to avoid encoding issues. */
#root > div > div:first-child {
  border-top: 4px solid var(--brand-red) !important;
}

#root > div > div:first-child h1::before {
  content: "Корпоративный маршрут активности";
}

#root > div > div:nth-child(2) {
  max-width: 1800px;
  margin: 0 auto;
}

.leaflet-container {
  outline: 6px solid rgba(255, 255, 255, 0.7) !important;
}

#root > div > div:nth-child(2) > div:last-child > div:first-child h3::before {
  content: "Администрирование";
}

#root > div > div:nth-child(2) > div:last-child > div:nth-child(2) h3::before {
  content: "Сводка";
}

#root > div > div:nth-child(2) > div:last-child > div:last-child h2::before {
  content: "Город маршрута";
}

button[aria-label*="\0417\0430\043A\0440\044B\0442\044C"],
button[aria-label*="\0423\0434\0430\043B\0438\0442\044C"] {
  min-width: 44px !important;
}

/* v17: HR-only mode. User activity/leaderboards are disabled. */
body.ux-enhanced #root > div {
  padding-left: 0 !important;
}

#root > div > div:nth-child(2) {
  grid-template-areas:
    "status status"
    "map panel" !important;
}

.ux-left-nav,
.ux-activity-hub,
.ux-route-timeline {
  display: none !important;
}

.leaflet-overlay-pane svg {
  overflow: visible !important;
}

.leaflet-overlay-pane svg path {
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke;
}

.ux-route-red {
  stroke: #f31824 !important;
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 7px rgba(227, 30, 36, 0.34))
    drop-shadow(0 10px 16px rgba(120, 16, 22, 0.18)) !important;
}

.ux-route-current {
  stroke-dasharray: 14 10 !important;
  animation: ux-route-flow 1.05s linear infinite;
}

.ux-route-done {
  stroke-dasharray: 1 0 !important;
}

.leaflet-marker-icon div[style*="background:#ef4444"],
.leaflet-marker-icon div[style*="background: #ef4444"] {
  background: #f31824 !important;
  border: 2px solid #fff !important;
  box-shadow:
    0 0 0 5px rgba(243, 24, 36, 0.16),
    0 0 0 10px rgba(243, 24, 36, 0.07),
    0 10px 22px rgba(23, 26, 31, 0.22) !important;
}

/* v33: panel roles are assigned by ux-enhance.js; do not rely on nth-child
   because the Stats panel is removed by React when a city is selected. */
#root > div > div:nth-child(2) > div:last-child > .ux-panel-stats {
  order: 1 !important;
  flex: 0 0 auto !important;
  padding: 12px 14px !important;
  background:
    linear-gradient(135deg, rgba(227, 30, 36, 0.08), rgba(255, 255, 255, 0) 60%),
    var(--surface) !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-stats h3::before {
  content: "Сводка" !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-stats > div:not(.ux-visited-cities) {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 7px 0 !important;
  color: var(--muted) !important;
  border-bottom: 1px solid #edf0f3 !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-stats > hr,
#root > div > div:nth-child(2) > div:last-child > .ux-panel-stats > hr + div:not(.ux-visited-cities) {
  display: none !important;
}

.ux-visited-panel {
  order: 2 !important;
  flex: 0 0 auto !important;
  max-height: 280px;
  padding: 12px 14px !important;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(227, 30, 36, 0.06), rgba(255, 255, 255, 0) 58%),
    var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

.ux-visited-panel .ux-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0f3;
}

.ux-visited-panel .ux-panel-heading span {
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ux-visited-panel .ux-panel-heading strong {
  min-width: 34px;
  padding: 4px 9px;
  color: var(--brand-red) !important;
  background: rgba(227, 30, 36, 0.08);
  border: 1px solid rgba(227, 30, 36, 0.18);
  border-radius: 999px;
  font-size: 13px !important;
  line-height: 1;
  text-align: center;
}

.ux-visited-panel .ux-visited-cities__list {
  max-height: 216px;
  display: grid;
  gap: 7px;
  overflow-y: auto;
  padding-right: 4px;
}

.ux-visited-panel .ux-route-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid #edf0f3;
  border-radius: var(--radius);
}

.ux-visited-panel .ux-route-step i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #9aa3af;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ux-visited-panel .ux-route-step strong {
  display: block;
  color: var(--ink) !important;
  font-size: 14px !important;
  line-height: 1.15;
}

.ux-visited-panel .ux-route-step span {
  display: block;
  margin-top: 2px;
  color: var(--muted) !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.ux-visited-panel .ux-route-step--latest {
  background: rgba(227, 30, 36, 0.055);
  border-color: rgba(227, 30, 36, 0.22);
}

.ux-visited-panel .ux-route-step--latest i {
  background: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.12);
}

.ux-visited-panel .ux-route-step--latest span {
  color: var(--brand-red) !important;
}

.ux-empty-note {
  padding: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city {
  order: 3 !important;
  flex: 1 1 150px !important;
  min-height: 112px !important;
  overflow-y: auto !important;
  padding: 12px 14px !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city h2::before {
  content: "Город маршрута" !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city > div {
  display: block !important;
  padding: 0 !important;
  color: var(--muted) !important;
  border-bottom: 0 !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city > div:first-child {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city > div:last-child {
  display: block !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city img {
  display: block !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
}

#root > div > div:nth-child(2) > div:last-child > .ux-panel-city button {
  flex: 0 0 auto !important;
}

.ux-linked-description a,
.ux-panel-city a {
  color: var(--brand-red) !important;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.ux-linked-description a:hover,
.ux-linked-description a:focus-visible,
.ux-panel-city a:hover,
.ux-panel-city a:focus-visible {
  color: var(--brand-red-dark) !important;
  outline: none;
}

.ux-save-description {
  width: 100% !important;
  margin: 10px 0 0 !important;
  border-color: var(--brand-red) !important;
  background: var(--brand-red) !important;
  color: #fff !important;
}

.ux-save-description:disabled {
  cursor: wait !important;
  opacity: 0.72;
}

.ux-save-description-status {
  display: block;
  min-height: 18px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ux-city-description {
  display: block !important;
  margin-top: 12px !important;
  padding-top: 12px !important;
  color: var(--ink) !important;
  border-top: 1px solid #edf0f3 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  line-height: 1.5 !important;
}

#root > div > div:nth-child(2) > div:last-child > div.ux-panel-city > div.ux-city-description,
#root > div > div:nth-child(2) > div:last-child > div:nth-child(2).ux-panel-city > div.ux-city-description,
#root > div > div:nth-child(2) > div:last-child > div:last-child.ux-panel-city > div.ux-city-description {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 20px !important;
}
