:root {
  --bg: #e8edf4;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --line: #d3dde8;
  --line-soft: rgba(148, 163, 184, 0.38);
  --accent: #475569;
  --brand-teal: #14b8a6;
  --brand-teal-mid: #2dd4bf;
  --brand-teal-light: #5eead4;
  --sidebar: #070b12;
  --sidebar-hover: rgba(148, 163, 184, 0.12);
  --sidebar-active: rgba(45, 212, 191, 0.16);
  --sidebar-ring: rgba(45, 212, 191, 0.45);
  --sidebar-text: #f1f5f9;
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 12px 28px -6px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 44px -12px rgba(15, 23, 42, 0.18);
  --radius: 12px;
  --radius-lg: 16px;
  --ok: #1e9c63;
  --warn: #c08a2d;
  --danger: #c24848;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Не даем кастомным классам перебивать hidden-секции */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  transition: grid-template-columns 0.2s ease;
}

body.sidebar-collapsed .app {
  grid-template-columns: 86px 1fr;
}

.sidebar {
  background:
    radial-gradient(100% 80% at 0% 0%, rgba(45, 212, 191, 0.14) 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #0c1220 0%, var(--sidebar) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  padding: 22px 14px;
  transition: transform 0.25s ease, width 0.2s ease, padding 0.2s ease;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar {
  padding: 20px 10px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.3px;
  color: var(--sidebar-text);
  line-height: 1.08;
  font-weight: 700;
}

.brand p {
  margin-top: 8px;
  color: #9fb0d4;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.35px;
}

.brand .brand-kicker {
  margin: 0 0 8px;
  color: var(--brand-teal-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  font-weight: 700;
}

body.sidebar-collapsed .brand p {
  display: none;
}

body.sidebar-collapsed .brand .brand-kicker {
  display: none;
}

body.sidebar-collapsed .brand h1 {
  font-size: 15px;
  letter-spacing: 0.8px;
}

.tabs {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  color: var(--sidebar-text);
  padding: 11px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.tab .icon {
  min-width: 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
  color: #cbd5e1;
}

.tab.active .icon {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.1);
}

.tab .icon-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.tab .label {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.tab:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--sidebar-hover);
  transform: translateX(2px);
}

.tab.active {
  background: var(--sidebar-active);
  border-color: var(--sidebar-ring);
  box-shadow:
    inset 0 0 0 1px rgba(94, 234, 212, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.25);
}

.tab-plan {
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.12);
}

body.sidebar-collapsed .tab {
  justify-content: center;
  padding: 9px;
}

body.sidebar-collapsed .tab .label {
  display: none;
}

.content {
  padding: 22px max(26px, env(safe-area-inset-right, 0px)) max(32px, env(safe-area-inset-bottom, 0px))
    max(26px, env(safe-area-inset-left, 0px));
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 85% 55% at 95% -5%, rgba(45, 212, 191, 0.09) 0%, transparent 52%),
    radial-gradient(ellipse 70% 45% at -5% 40%, rgba(59, 130, 246, 0.06) 0%, transparent 48%),
    linear-gradient(180deg, var(--bg) 0%, #eef2f8 100%);
}

.topbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top, 0px));
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 14px 20px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: min(100%, 520px);
}

.team-delete-hint {
  flex: 1 1 220px;
  font-size: 12px;
  color: #98a2b3;
  line-height: 1.35;
  text-align: right;
}

.dashboard-block.team-list-block .block-head {
  padding: 10px 14px;
  align-items: flex-start;
}

.dashboard-block.team-list-block .block-head p {
  margin: 3px 0 0;
  line-height: 1.35;
}

.team-head-filters {
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 420px);
}

.dashboard-block.team-list-block .team-list-body {
  padding-top: 10px;
}

.team-sort-hint {
  font-size: 12px;
  color: #98a2b3;
  white-space: nowrap;
}

.menu-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 11px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.menu-btn:hover {
  background: var(--surface);
  border-color: rgba(45, 212, 191, 0.35);
}

.topbar-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chip {
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
  color: #0f766e;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-secondary);
  border-radius: 11px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ghost-btn:hover {
  background: var(--surface);
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.ghost-btn.primary-btn {
  border: none;
  color: #042f2e;
  background: linear-gradient(135deg, var(--brand-teal-light) 0%, var(--brand-teal-mid) 45%, var(--brand-teal) 100%);
  box-shadow:
    0 4px 16px rgba(20, 184, 166, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.ghost-btn.primary-btn:hover {
  filter: brightness(1.05);
  box-shadow:
    0 6px 22px rgba(20, 184, 166, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.28) inset;
}

/* ——— Auth flow (fullscreen) ——— */
.auth-flow {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  overflow: hidden;
  padding: max(12px, env(safe-area-inset-top, 0px)) 0 max(20px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

/* Полосы прокрутки не показываем (колёсико / тач / клавиши работают) */
.auth-flow-aside,
.auth-flow-card-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.auth-flow-aside::-webkit-scrollbar,
.auth-flow-card-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

.auth-card-flow select.auth-flow-input.settings-select {
  position: relative;
  z-index: 4;
  transform: translateZ(0);
  -webkit-appearance: menulist;
  appearance: auto;
}

.auth-flow-field:has(#authSportCode) {
  position: relative;
  z-index: 5;
  overflow: visible;
}

.auth-flow.hidden {
  display: none !important;
}

.auth-flow-bg {
  position: absolute;
  inset: 0;
  background: #070b12;
  overflow: hidden;
}

.auth-flow-orbs {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(45, 212, 191, 0.22) 0%, transparent 42%),
    radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 38%),
    radial-gradient(circle at 70% 85%, rgba(16, 185, 129, 0.12) 0%, transparent 35%);
  filter: blur(2px);
}

@media (prefers-reduced-motion: no-preference) {
  .auth-flow-orbs {
    animation: auth-flow-orbs-drift 22s ease-in-out infinite alternate;
  }
}

@keyframes auth-flow-orbs-drift {
  0% {
    transform: translate(-2%, 1%) scale(1);
  }
  100% {
    transform: translate(2%, -1%) scale(1.04);
  }
}

.auth-flow-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: 0 0, 0 0;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, black 10%, transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
  .auth-flow-grid {
    animation: auth-flow-grid-drift 36s linear infinite;
  }
}

@keyframes auth-flow-grid-drift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 48px 48px, 48px 48px;
  }
}

.auth-flow-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 460px);
  gap: clamp(20px, 3.2vw, 36px);
  align-items: flex-start;
  width: 100%;
  max-width: 1180px;
  max-height: calc(100dvh - max(32px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px);
  box-sizing: border-box;
  overflow: hidden;
}

@media (max-width: 900px) {
  .auth-flow {
    align-items: flex-start;
    justify-content: center;
  }

  .auth-flow-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - max(24px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
    padding-left: clamp(12px, 4vw, 36px);
    padding-right: clamp(12px, 4vw, 36px);
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .auth-flow-aside {
    display: none;
  }

  .auth-flow-mobile-pitch {
    display: flex;
    grid-column: 1;
    flex-shrink: 0;
    padding-bottom: 16px;
  }

  .auth-flow-main {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    align-self: stretch;
    align-items: stretch;
  }

  .auth-card-flow {
    max-width: 100%;
    max-height: 100%;
  }
}

.auth-flow-aside {
  --auth-land-measure: min(100%, 36rem);
  color: rgba(248, 250, 252, 0.92);
  padding-right: clamp(4px, 2vw, 20px);
  min-width: 0;
  max-height: calc(100dvh - max(48px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.auth-flow-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  color: #042f2e;
  background: linear-gradient(145deg, #5eead4 0%, #2dd4bf 40%, #14b8a6 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 12px 32px rgba(15, 118, 110, 0.35);
  margin-bottom: 20px;
}

.auth-flow-brand-name {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* Лендинг на экране входа (левая колонка + мобильный блок) */
.auth-land-badge {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(204, 251, 241, 0.98);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.38);
}

.auth-land-badge--mobile {
  margin-bottom: 8px;
}

.auth-land-headline {
  margin: 0 0 18px;
  max-width: var(--auth-land-measure, min(100%, 36rem));
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.55;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.9);
  letter-spacing: -0.018em;
}

.auth-land-headline--mobile {
  margin: 0 0 14px;
  max-width: min(100%, 36rem);
  font-size: 15px;
  line-height: 1.45;
}

.auth-land-steps {
  display: flex;
  align-items: stretch;
  margin: 0 0 20px;
  max-width: var(--auth-land-measure, min(100%, 36rem));
}

.auth-land-step {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  padding: 12px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.auth-land-step:hover {
  transform: translateY(-3px);
  border-color: rgba(45, 212, 191, 0.38);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(45, 212, 191, 0.1);
}

.auth-land-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #042f2e;
  background: linear-gradient(145deg, #5eead4, #14b8a6);
  border-radius: 9px;
  box-shadow: 0 2px 12px rgba(20, 184, 166, 0.38);
}

.auth-land-step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.auth-land-step-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(248, 250, 252, 0.95);
}

.auth-land-step-text {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.9);
}

.auth-land-step-connector {
  align-self: center;
  width: 14px;
  height: 2px;
  flex-shrink: 0;
  margin: 0 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(45, 212, 191, 0.15),
    rgba(45, 212, 191, 0.75),
    rgba(45, 212, 191, 0.15)
  );
}

.auth-land-steps--mobile {
  flex-direction: row;
  width: 100%;
  max-width: 100%;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0 2px;
}

.auth-land-step--mobile {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 5px;
  gap: 6px;
}

.auth-land-step--mobile .auth-land-step-num {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.auth-land-step--mobile .auth-land-step-title {
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-land-badge {
    animation: auth-land-badge-glow 4.5s ease-in-out infinite;
  }

  .auth-flow-aside .auth-flow-brand-mark {
    animation: auth-brand-nudge 6s ease-in-out infinite;
  }

  .auth-land-step {
    animation: auth-land-reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .auth-land-steps > .auth-land-step:nth-child(1) {
    animation-delay: 0.05s;
  }

  .auth-land-steps > .auth-land-step:nth-child(3) {
    animation-delay: 0.14s;
  }

  .auth-land-steps > .auth-land-step:nth-child(5) {
    animation-delay: 0.23s;
  }

  .auth-land-step-connector {
    animation: auth-land-connector-pulse 2.6s ease-in-out infinite;
  }

  .auth-land-steps--mobile .auth-land-step {
    animation: auth-land-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .auth-land-steps--mobile .auth-land-step:nth-child(1) {
    animation-delay: 0.04s;
  }

  .auth-land-steps--mobile .auth-land-step:nth-child(2) {
    animation-delay: 0.1s;
  }

  .auth-land-steps--mobile .auth-land-step:nth-child(3) {
    animation-delay: 0.16s;
  }
}

@keyframes auth-land-badge-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
  }
  50% {
    box-shadow: 0 0 22px 1px rgba(45, 212, 191, 0.18);
  }
}

@keyframes auth-brand-nudge {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.03) translateY(-1px);
  }
}

@keyframes auth-land-reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-land-connector-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleX(0.92);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-land-badge,
  .auth-flow-aside .auth-flow-brand-mark,
  .auth-land-step,
  .auth-land-step-connector,
  .auth-land-steps--mobile .auth-land-step {
    animation: none !important;
  }

  .auth-land-step:hover {
    transform: none;
  }
}

/* Auth: 3D «кубик» с тезисами + полоска в духе рубика */
.auth-flow-motion-block {
  position: relative;
  margin: 0 auto 14px;
  /* Запас под «вылезающую» при 3D-повороте грань и тень — без этого абзац ниже наезжает на панель */
  padding-bottom: 52px;
  max-width: var(--auth-land-measure, min(100%, 36rem));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-flow-cube-show {
  --cube-w: 312px;
  --cube-h: 100px;
  --cube-d: 258px;
  --tx: calc(var(--cube-w) / 2);
  --tz: calc(var(--cube-d) / 2);
  position: relative;
  isolation: isolate;
  perspective: 1320px;
  perspective-origin: 50% 38%;
  width: var(--cube-w);
  height: var(--cube-h);
  max-width: 100%;
  margin: 0 0 8px;
}

/* Мягкое «поле» под призмой — глубина без тяжёлого blur */
.auth-flow-cube-show::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: calc(var(--cube-w) + 72px);
  height: calc(var(--cube-h) + 88px);
  transform: translate(-50%, -50%);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 72% 58% at 50% 42%, rgba(45, 212, 191, 0.16) 0%, transparent 62%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(15, 23, 42, 0.45) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}

.auth-flow-cube-show--compact {
  --cube-w: min(92vw, 288px);
  --cube-h: 86px;
  --cube-d: 222px;
  margin-left: auto;
  margin-right: auto;
}

.auth-flow-cube-float {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: auth-flow-cube-float 5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

.auth-flow-cube-pivot {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: auth-flow-cube-turn 20s cubic-bezier(0.5, 0.02, 0.2, 1) infinite;
  will-change: transform;
}

.auth-flow-cuboid {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cube-w);
  height: var(--cube-h);
  margin-left: calc(var(--cube-w) / -2);
  margin-top: calc(var(--cube-h) / -2);
  transform-style: preserve-3d;
}

.auth-flow-cuboid-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 13px 17px;
  text-align: center;
  font-size: clamp(12.5px, 1.05vw, 14px);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.42;
  color: rgba(248, 250, 252, 0.96);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(
    168deg,
    rgba(45, 212, 191, 0.11) 0%,
    rgba(30, 41, 59, 0.78) 18%,
    rgba(15, 23, 42, 0.9) 52%,
    rgba(15, 23, 42, 0.94) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    0 0 0 1px rgba(20, 184, 166, 0.28) inset,
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 22px 52px rgba(0, 0, 0, 0.52),
    0 10px 28px rgba(20, 184, 166, 0.07);
}

.auth-flow-cube-show--compact .auth-flow-cuboid-face {
  font-size: clamp(11.5px, 3.1vw, 13px);
  padding: 11px 13px;
  border-radius: 8px;
}

.auth-flow-cuboid-face[data-face="0"] {
  transform: rotateY(0deg) translateZ(var(--tz));
}

.auth-flow-cuboid-face[data-face="1"] {
  transform: rotateY(90deg) translateZ(var(--tx));
}

.auth-flow-cuboid-face[data-face="2"] {
  transform: rotateY(180deg) translateZ(var(--tz));
}

.auth-flow-cuboid-face[data-face="3"] {
  transform: rotateY(-90deg) translateZ(var(--tx));
}

@keyframes auth-flow-cube-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes auth-flow-cube-turn {
  0%,
  10% {
    transform: rotateX(-12deg) rotateY(0deg);
  }
  15%,
  27% {
    transform: rotateX(-12deg) rotateY(90deg);
  }
  32%,
  44% {
    transform: rotateX(-12deg) rotateY(180deg);
  }
  49%,
  61% {
    transform: rotateX(-12deg) rotateY(270deg);
  }
  66%,
  90% {
    transform: rotateX(-12deg) rotateY(360deg);
  }
  95%,
  100% {
    transform: rotateX(-12deg) rotateY(360deg);
  }
}

.auth-flow-tagline--static {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-flow-cube-float,
  .auth-flow-cube-pivot {
    animation: none !important;
    will-change: auto;
  }

  .auth-flow-cube-show {
    display: none;
  }

  .auth-flow-tagline--static {
    position: static;
    width: 100%;
    max-width: var(--auth-land-measure, min(100%, 36rem));
    height: auto;
    margin: 0 0 14px;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: rgba(248, 250, 252, 0.88);
    text-align: center;
  }
}

.auth-flow-aside-lede {
  margin: -6px 0 20px;
  max-width: var(--auth-land-measure, min(100%, 36rem));
  font-size: 15px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.72);
  font-weight: 450;
}

.auth-flow-benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: var(--auth-land-measure, min(100%, 36rem));
}

.auth-flow-benefit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.82);
}

.auth-flow-benefit-mark {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5eead4, #14b8a6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.22);
}

.auth-flow-benefit-text strong {
  font-weight: 600;
  color: rgba(241, 245, 249, 0.95);
}

.auth-flow-mobile-pitch {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin: 0 0 4px;
  padding: 0 clamp(8px, 4vw, 20px) 44px;
}

.auth-flow-mobile-motion-fallback {
  display: none;
  margin: 0 auto 4px;
  max-width: 22em;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.88);
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .auth-flow-mobile-motion-fallback {
    display: block;
  }
}

.auth-flow-mobile-tagline {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.88);
}

.auth-flow-mobile-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.auth-flow-chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-flow-main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
}

.auth-card-flow {
  width: 100%;
  max-width: 428px;
  padding: 22px 24px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, calc(100dvh - max(56px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))));
  min-height: 0;
  overflow: hidden;
}

.auth-flow-card-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.auth-flow-card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.auth-lang-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}

.auth-segment {
  display: flex;
  padding: 4px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(203, 213, 225, 0.85);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.auth-segment-btn:hover {
  color: #f8fafc;
}

.auth-segment-btn.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.auth-flow-title {
  margin: 4px 0 0;
  font-size: clamp(1.22rem, 2.9vw, 1.38rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.auth-flow-intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.95);
  font-weight: 450;
}

.auth-flow-register-hint {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(203, 213, 225, 0.92);
  font-weight: 450;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid rgba(45, 212, 191, 0.5);
}

.auth-flow-message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.auth-flow-message--error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.auth-flow-message--success {
  color: #ccfbf1;
  background: rgba(19, 78, 74, 0.45);
  border: 1px solid rgba(45, 212, 191, 0.28);
}

.auth-flow-message--info {
  color: rgba(226, 232, 240, 0.95);
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-flow-reset-nav {
  margin: 4px 0 0;
}

.auth-flow-reset-nav[hidden] {
  display: none !important;
}

.auth-link-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #5eead4;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link-btn:hover {
  color: #99f6e4;
}

.auth-flow-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: none;
  width: 100%;
}

.auth-flow-step {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 640px) {
  .auth-flow-step:first-of-type {
    padding-top: 0;
    border-top: none;
  }
}

.auth-flow-step--plain {
  border-top: none;
  padding-top: 0;
  gap: 12px;
}

.auth-flow-step-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(94, 234, 212, 0.75);
}

.auth-flow-field {
  gap: 4px;
  margin: 0;
}

.auth-flow-field.form-label {
  color: rgba(226, 232, 240, 0.88);
  font-size: 12px;
  font-weight: 500;
}

.auth-flow-input.form-input,
.auth-flow-input.settings-select {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: #f8fafc;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 15px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.auth-flow-input.form-input::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

.auth-flow-input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
  background: rgba(0, 0, 0, 0.28);
}

select.auth-flow-input.settings-select option {
  background: #0f172a;
  color: #f1f5f9;
}

.auth-flow-fields--staff .auth-flow-step-kicker {
  display: none;
}

.auth-flow-secondary-btn {
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.auth-flow-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.auth-flow-row-end {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-flow-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 12px;
}

.auth-flow-submit {
  width: 100%;
  border: none;
  border-radius: 6px;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #042f2e;
  background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 48%, #14b8a6 100%);
  box-shadow:
    0 4px 20px rgba(20, 184, 166, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition:
    transform 0.12s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.auth-flow-submit:hover {
  filter: brightness(1.06);
  box-shadow:
    0 8px 28px rgba(20, 184, 166, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.auth-flow-submit:active {
  transform: scale(0.99);
}

body.auth-required .app {
  display: none;
}

body.auth-required .auth-flow:not(.hidden) {
  display: flex;
}

body.auth-ready .auth-flow {
  display: none !important;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.home-action-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.home-action-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 253, 250, 0.7) 100%);
  padding: 14px;
  box-shadow: var(--shadow);
}

.home-action-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f766e;
  font-weight: 700;
}

.home-action-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}

.home-action-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.live-badge {
  border: 1px solid rgba(45, 212, 191, 0.32);
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dashboard-block {
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.block-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%);
}

.block-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.block-head p {
  margin: 6px 0 0;
  font-size: 13px;
}

.block-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.block-period,
.collapse-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
}

.collapse-btn {
  cursor: pointer;
}

.collapse-btn:hover {
  background: var(--surface-soft);
}

.block-body {
  padding: 18px 20px 20px;
}

.risk-score-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.06) 0%, var(--surface-soft) 50%, var(--surface) 100%);
  margin-bottom: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.risk-score-card h4 {
  margin: 0;
  font-size: 15px;
}

.risk-score-card p {
  margin: 4px 0 0;
  font-size: 12px;
}

.risk-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.risk-score {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.risk-label {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.risk-label.low {
  background: #eaf7ef;
  color: #207a4f;
}

.risk-label.medium {
  background: #fff6e8;
  color: #9a6b10;
}

.risk-label.high {
  background: #ffecef;
  color: #a73647;
}

.dashboard-block.collapsed .block-body {
  display: none;
}

.dashboard-block.collapsed .collapse-btn {
  background: #f3f5fa;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.cards.compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.cards.compact.cards-status-four {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.card,
.block {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.card:hover,
.block:hover {
  box-shadow: var(--shadow), 0 0 0 1px rgba(45, 212, 191, 0.08);
}

.card.warning {
  border-color: var(--warn);
}

.card.monitor {
  border-color: rgba(59, 130, 246, 0.45);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.07) 0%, var(--surface) 100%);
}

.card.danger {
  border-color: var(--danger);
}

.block.primary {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.07) 0%, var(--surface-soft) 100%);
  border-color: rgba(45, 212, 191, 0.35);
}

.card h3,
.block h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.metric {
  font-size: 36px;
  font-weight: 700;
  margin: 12px 0 4px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

.status-table tbody tr {
  cursor: pointer;
}

.status-table tbody tr:hover {
  background: rgba(20, 184, 166, 0.04);
}

.status-table tbody tr.selected-row {
  background: rgba(45, 212, 191, 0.1);
}

.status-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  vertical-align: bottom;
}

.status-table th.sortable-th:hover {
  color: #384152;
  background: #f9fafb;
}

.status-table th.sortable-th .th-label {
  margin-right: 4px;
}

.status-table th.sortable-th .th-hint {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: #98a2b3;
  line-height: 1.2;
}

.status-table th.team-progression-th {
  font-size: 11px;
  font-weight: 600;
  vertical-align: bottom;
}

.status-table td.team-progression-cell {
  max-width: 220px;
  font-size: 11px;
  line-height: 1.35;
  color: #4b5565;
  word-break: break-word;
}

.drawer-hint {
  margin: 0.35rem 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.drawer-progression-summary {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e8eaef;
}

.drawer-muted {
  color: #98a2b3;
  font-weight: 400;
}


.status-table th.sortable-th .sort-indicator {
  display: inline-block;
  font-size: 10px;
  color: #98a2b3;
  min-width: 0.9em;
  opacity: 0.45;
}

.status-table th.sortable-th:hover .sort-indicator {
  opacity: 0.85;
}

.status-table th.sortable-th.sorted-asc .sort-indicator::after {
  content: "▲";
  color: #384152;
  opacity: 1;
}

.status-table th.sortable-th.sorted-desc .sort-indicator::after {
  content: "▼";
  color: #384152;
  opacity: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill.ready {
  background: #eaf7ef;
  color: #207a4f;
}

.pill.risk {
  background: #fff6e8;
  color: #9a6b10;
}

.pill.monitor {
  background: #eff6ff;
  color: #1d4ed8;
}

.pill.injured {
  background: #ffecef;
  color: #a73647;
}

.pill.nodata {
  background: #e8ecf3;
  color: #475569;
}

.dashboard-empty-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.score-badge {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #d8dee9;
  font-size: 12px;
  font-weight: 700;
}

.score-badge.low {
  background: #effaf3;
  color: #1f7a50;
}

.score-badge.medium {
  background: #fff8eb;
  color: #9a6b10;
}

.score-badge.high {
  background: #ffeff1;
  color: #ad2f46;
}

.metric-badge {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #d8dee9;
  font-size: 12px;
  font-weight: 700;
}

.metric-badge.good {
  background: #effaf3;
  color: #1f7a50;
}

.metric-badge.warn {
  background: #fff8eb;
  color: #9a6b10;
}

.metric-badge.danger {
  background: #ffeff1;
  color: #ad2f46;
}

.metric-badge.na {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

.fatigue-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fatigue-track {
  position: relative;
  width: 92px;
  height: 7px;
  border-radius: 999px;
  background: #e6ebf3;
  overflow: hidden;
}

.fatigue-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
}

.fatigue-fill.low {
  background: #83c89a;
}

.fatigue-fill.medium {
  background: #e8c67a;
}

.fatigue-fill.high {
  background: #dc8e8e;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-btn {
  border: 1px solid #d4dbe8;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.mini-btn.danger {
  border-color: #efc1c8;
  color: #9f2f43;
  background: #fff5f7;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  /* Явная высота нужна, иначе height: N% у столбцов не считается и график «пустой» */
  height: 150px;
  min-height: 150px;
  padding-top: 8px;
}

.mini-chart .bar {
  flex: 1;
  min-width: 12px;
  background: #d2d9e6;
  border-radius: 6px 6px 2px 2px;
  position: relative;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.mini-chart .bar.load {
  background: linear-gradient(180deg, #5eead4 0%, #0d9488 100%);
}

.mini-chart .bar.state {
  background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
}

.mini-chart .bar.good {
  background: #9ecfa8;
}

.mini-chart .bar.warn {
  background: #e8c67a;
}

.mini-chart .bar.danger {
  background: #dc8e8e;
}

.mini-chart .bar:hover {
  transform: translateY(-2px);
}

.mini-chart .bar.active {
  box-shadow: 0 0 0 2px #374151 inset;
  opacity: 1;
}

.mini-chart .bar:not(.active) {
  opacity: 0.88;
}

.mini-chart .bar span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -20px;
  font-size: 11px;
  color: #6b7280;
}

.mini-chart .bar i {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 11px;
  color: #4b5563;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.mini-chart .bar:hover i,
.mini-chart .bar.active i {
  opacity: 1;
}

.day-detail-card {
  margin-top: 14px;
}

.selected-day-list {
  margin: 8px 0 0;
  padding-left: 16px;
}

.selected-day-list li {
  margin-bottom: 4px;
}

.future-note {
  margin-top: 10px;
  font-size: 12px;
  color: #7b8497;
}

.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.alerts-list li {
  padding: 10px 12px;
  border: 1px solid #e3e8f2;
  border-radius: 10px;
  background: #fafbfd;
  font-size: 13px;
}

.alerts-list li.critical {
  border-color: #f1c7cf;
  background: #fff5f7;
}

.alerts-list li.warning {
  border-color: #f4d9a4;
  background: #fff9ef;
}

.alerts-list li.info {
  border-color: #d7dfea;
  background: #f6f9fd;
}

.alert-tag {
  display: inline-block;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.threshold.good {
  color: #207a4f;
}

.threshold.warn {
  color: #9a6b10;
}

.threshold.danger {
  color: #a73647;
}

.player-drawer {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 18, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 50;
}

.player-drawer.open {
  display: flex;
}

.player-drawer-panel {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-left: 1px solid var(--line-soft);
  box-shadow: -24px 0 48px rgba(15, 23, 42, 0.16);
  padding: 20px;
}

.player-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.player-drawer-head h3 {
  margin: 0;
}

.drawer-close {
  border: 1px solid #d3d9e6;
  background: #f7f9fc;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.player-drawer-content {
  display: grid;
  gap: 10px;
}

.drawer-item {
  border: 1px solid #e5eaf3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafbfd;
}

.drawer-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-stat {
  border: 1px solid #e5eaf3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fbff;
}

.drawer-stat-label {
  font-size: 12px;
  color: #667085;
  margin-bottom: 6px;
}

.drawer-risk {
  font-weight: 700;
}

.drawer-risk.good {
  color: #207a4f;
}

.drawer-risk.warn {
  color: #9a6b10;
}

.drawer-risk.danger {
  color: #a73647;
}

.drawer-metric-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.drawer-recent-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.form-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #475267;
}

.form-input {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.settings-select:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.65);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

.settings-select {
  border-radius: 11px;
  font-family: inherit;
}

.plan-lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 52rem;
}

.plan-schedule-grid {
  margin-bottom: 8px;
}

/* —— План: хаб в духе календаря (toolbar + основная зона + боковая форма) —— */
.plan-hub-h2 {
  margin-bottom: 6px;
}

.plan-hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.plan-hub-toolbar-nav.plan-period-bar {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  flex: 1 1 240px;
  min-width: 0;
}

.plan-hub-toolbar-nav .plan-period-nav {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.plan-hub-toolbar-nav .plan-period-label.plan-hub-period-label {
  white-space: normal;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  text-align: left;
  flex: 1 1 160px;
}

.plan-hub-period-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  flex: 1 1 auto;
  text-align: center;
  min-width: 120px;
  line-height: 1.3;
}

.plan-hub-cal-btn,
.plan-hub-today-btn {
  flex-shrink: 0;
}

.plan-hub-toolbar-views {
  flex-shrink: 0;
}

.plan-view-segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  gap: 2px;
}

.plan-view-segmented .plan-period-mode {
  margin: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}

.plan-view-segmented .plan-period-mode:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.plan-view-segmented .plan-period-mode.active {
  background: rgba(20, 184, 166, 0.18);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.plan-view-segmented .plan-period-mode:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.55);
  outline-offset: 2px;
}

.plan-surface.plan-main-surface,
.plan-surface.plan-form-surface {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.plan-hub-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(272px, 320px);
  gap: 18px;
  align-items: stretch;
}

/* Неделя/месяц: чуть шире колонка формы, чтобы «Событие» не уезжало под скролл на типичных экранах */
#planScheduleMovableGrid[data-plan-mode="week"],
#planScheduleMovableGrid[data-plan-mode="month"] {
  grid-template-columns: minmax(0, 1fr) minmax(288px, 360px);
}

.plan-hub-main-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-hub-side-col {
  min-width: 0;
}

/* Неделя/месяц: таблица периода и форма события — одна строка, верх выровнен; календарь — в левой колонке под таблицей */
#planScheduleMovableGrid[data-plan-mode="week"],
#planScheduleMovableGrid[data-plan-mode="month"] {
  align-items: start;
}

#planScheduleMovableGrid[data-plan-mode="week"] .plan-hub-main-col,
#planScheduleMovableGrid[data-plan-mode="month"] .plan-hub-main-col {
  align-self: start;
}

#planScheduleMovableGrid[data-plan-mode="week"] .plan-hub-side-col,
#planScheduleMovableGrid[data-plan-mode="month"] .plan-hub-side-col {
  position: sticky;
  top: 8px;
  align-self: start;
}

#planScheduleMovableGrid[data-plan-mode="week"] #planFormArticle,
#planScheduleMovableGrid[data-plan-mode="month"] #planFormArticle {
  max-height: calc(100dvh - 120px);
}

#planScheduleMovableGrid[data-plan-mode="week"] .plan-agenda-day-section,
#planScheduleMovableGrid[data-plan-mode="month"] .plan-agenda-day-section {
  display: none;
}

.plan-day-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.plan-day-hero-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.plan-day-hero-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.plan-day-hero-date {
  margin: 0;
}

.plan-hub-date-input {
  min-width: 140px;
}

.plan-agenda-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.plan-agenda-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-agenda-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.plan-agenda-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.plan-agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.plan-agenda-mini-btn {
  font-size: 11px;
  padding: 4px 8px;
}

.plan-agenda-item--empty {
  color: var(--muted);
  font-size: 14px;
  border-style: dashed;
  justify-content: center;
  text-align: center;
}

.plan-agenda-time {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 3.2rem;
}

.plan-agenda-body {
  min-width: 0;
  flex: 1;
}

.plan-agenda-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.plan-agenda-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.plan-period-table-block {
  margin-top: 4px;
}

.plan-form-card-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.plan-form-card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}

.plan-form-card-hint {
  margin: 0;
  font-size: 12px;
}

.plan-hub-form-fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-form-more {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.plan-form-more-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.plan-form-more-summary::-webkit-details-marker {
  display: none;
}

.plan-form-more-summary::before {
  content: "▸ ";
  opacity: 0.5;
}

.plan-form-more[open] .plan-form-more-summary::before {
  content: "▾ ";
}

.plan-copy-day-box--nested {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

/* День: сетка ограничена по высоте; неделя/месяц — календарь в левой колонке под таблицей */
#plan.panel.active #planDayGridHost {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#plan.panel.active #planScheduleMovableGrid {
  min-height: 0;
  align-items: stretch;
}

#plan.panel.active #planScheduleMovableGrid.plan-schedule-grid--day-tight {
  max-height: calc(100dvh - 240px);
}

#plan.panel.active #planFormArticle,
#plan.panel.active #planDaySidebarArticle {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#plan.panel.active #planFormArticle .plan-form-card-head {
  flex-shrink: 0;
}

#plan.panel.active #planFormArticle .settings-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

#plan.panel.active #planDaySidebarArticle .plan-day-hero {
  flex-shrink: 0;
}

#plan.panel.active #planTodayEvents.plan-agenda-list {
  flex-shrink: 0;
  max-height: min(220px, 32vh);
  overflow-y: auto;
  margin-bottom: 14px;
}

#plan.panel.active #planDaySidebarArticle .plan-table-section-title {
  flex-shrink: 0;
}

#plan.panel.active #planDaySidebarArticle .plan-events-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 960px) {
  .plan-hub-split {
    grid-template-columns: 1fr;
  }

  #planScheduleMovableGrid[data-plan-mode="week"],
  #planScheduleMovableGrid[data-plan-mode="month"] {
    grid-template-columns: 1fr;
  }

  #planScheduleMovableGrid[data-plan-mode="week"] .plan-hub-side-col,
  #planScheduleMovableGrid[data-plan-mode="month"] .plan-hub-side-col {
    position: static;
  }

  #planScheduleMovableGrid[data-plan-mode="week"] #planFormArticle,
  #planScheduleMovableGrid[data-plan-mode="month"] #planFormArticle {
    max-height: none;
  }

  #plan.panel.active #planScheduleMovableGrid.plan-schedule-grid--day-tight {
    max-height: none;
  }
}

/* Тип события: лёгкий фон (таблица, повестка, ячейки недели) */
.plan-event-type--GYM {
  --plan-type-tint: rgba(59, 130, 246, 0.12);
  --plan-type-border: rgba(59, 130, 246, 0.22);
}

.plan-event-type--FIELD {
  --plan-type-tint: rgba(34, 197, 94, 0.12);
  --plan-type-border: rgba(34, 197, 94, 0.25);
}

.plan-event-type--MATCH {
  --plan-type-tint: rgba(245, 158, 11, 0.14);
  --plan-type-border: rgba(245, 158, 11, 0.28);
}

.plan-event-type--MEETING {
  --plan-type-tint: rgba(139, 92, 246, 0.12);
  --plan-type-border: rgba(139, 92, 246, 0.25);
}

.plan-event-type--REST {
  --plan-type-tint: rgba(100, 116, 139, 0.1);
  --plan-type-border: rgba(100, 116, 139, 0.2);
}

.plan-event-type--OFF {
  --plan-type-tint: rgba(148, 163, 184, 0.14);
  --plan-type-border: rgba(148, 163, 184, 0.28);
}

.plan-event-type--OTHER {
  --plan-type-tint: rgba(14, 165, 233, 0.1);
  --plan-type-border: rgba(14, 165, 233, 0.22);
}

#plan.panel.active tbody .plan-events-table tr.plan-event-type--GYM,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--FIELD,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--MATCH,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--MEETING,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--REST,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--OFF,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--OTHER {
  background: var(--plan-type-tint, var(--surface-soft));
}

#plan.panel.active tbody .plan-events-table tr.plan-event-type--GYM td,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--FIELD td,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--MATCH td,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--MEETING td,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--REST td,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--OFF td,
#plan.panel.active tbody .plan-events-table tr.plan-event-type--OTHER td {
  border-color: var(--plan-type-border, var(--line-soft));
}

.plan-agenda-item.plan-event-type--GYM,
.plan-agenda-item.plan-event-type--FIELD,
.plan-agenda-item.plan-event-type--MATCH,
.plan-agenda-item.plan-event-type--MEETING,
.plan-agenda-item.plan-event-type--REST,
.plan-agenda-item.plan-event-type--OFF,
.plan-agenda-item.plan-event-type--OTHER {
  background: var(--plan-type-tint, var(--surface-soft));
  border-color: var(--plan-type-border, var(--line-soft));
}

.plan-cal-ev.plan-event-type--GYM,
.plan-cal-ev.plan-event-type--FIELD,
.plan-cal-ev.plan-event-type--MATCH,
.plan-cal-ev.plan-event-type--MEETING,
.plan-cal-ev.plan-event-type--REST,
.plan-cal-ev.plan-event-type--OFF,
.plan-cal-ev.plan-event-type--OTHER {
  background: var(--plan-type-tint, var(--surface-soft));
  border-color: var(--plan-type-border, var(--line-soft));
}

.plan-table-quick-btn {
  font-size: 11px;
  padding: 4px 6px;
}

.plan-template-status {
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.4;
}

.plan-template-actions {
  margin-bottom: 10px;
}

.plan-template-apply-field {
  margin-top: 4px;
}

.plan-form-more--template + .plan-form-more {
  margin-top: 4px;
}

.plan-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.plan-copy-day-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 720px) {
  .plan-copy-day-box {
    grid-template-columns: 1fr;
  }
}

.plan-copy-day-field {
  margin: 0;
  min-width: 0;
}

.plan-copy-day-btn {
  justify-self: start;
}

@media (min-width: 721px) {
  .plan-copy-day-btn {
    justify-self: stretch;
    white-space: nowrap;
  }
}

.plan-week-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
  justify-content: flex-end;
  max-width: 100%;
}

.plan-open-day-btn {
  font-size: 11px;
  padding: 4px 8px;
}

.plan-month-cell-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.plan-secondary-block {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.plan-secondary-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 0;
  list-style: none;
}

.plan-secondary-summary::-webkit-details-marker {
  display: none;
}

.plan-secondary-summary::before {
  content: "▸ ";
  opacity: 0.55;
}

.plan-secondary-block[open] .plan-secondary-summary::before {
  content: "▾ ";
}

.plan-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-load-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ai-coach-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ai-coach-block .block-head {
  margin-bottom: 8px;
}

.ai-coach-status {
  margin: 10px 0 0;
  font-size: 13px;
}

.ai-coach-disclaimer {
  margin: 8px 0 0;
  font-size: 12px;
}

.ai-coach-text {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.03);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, ui-sans-serif, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(55vh, 520px);
  overflow: auto;
}

.drawer-coach-ai {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .plan-events-table {
    font-size: 13px;
  }
}

.gdoc-block .block-body.gdoc-body {
  padding-top: 12px;
}

.gdoc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.gdoc-input-wrap {
  flex: 1 1 240px;
  min-width: 0;
}

.gdoc-label {
  margin-bottom: 0;
}

.gdoc-input {
  width: 100%;
  margin-top: 6px;
}

.gdoc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gdoc-error {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--danger);
}

.gdoc-connected {
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(34, 197, 94, 0.06);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 0;
}

.gdoc-connected p {
  margin: 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.gdoc-placeholder {
  border: 1px dashed #c5cdd9;
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdoc-placeholder p {
  margin: 0;
  max-width: 360px;
}

.gdoc-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #98a2b3;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .home-action-strip {
    grid-template-columns: 1fr;
  }

  .gdoc-actions {
    width: 100%;
  }

  .gdoc-actions .ghost-btn {
    flex: 1;
  }
}

/* ---------- Analytics ---------- */
.analytics-page .analytics-lede {
  font-size: 13px;
  max-width: 720px;
  margin: 8px 0 0;
}

.analytics-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.analytics-page .analytics-lede strong {
  color: #384152;
}

.analytics-header .block-period {
  flex-shrink: 0;
}

.analytics-simple-grid .block-body {
  display: grid;
  gap: 10px;
}

.analytics-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.insight-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.insight-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  border-left: 4px solid var(--brand-teal);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.insight-card.sev-critical {
  border-left-color: var(--danger);
  background: #fffafb;
}

.insight-card.sev-warning {
  border-left-color: var(--warn);
  background: #fffdf8;
}

.insight-card.sev-ok {
  border-left-color: var(--ok);
  background: #f8fcfa;
}

.insight-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.insight-sev-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.insight-sev-badge.critical {
  background: #ffecef;
  color: #a73647;
}

.insight-sev-badge.warning {
  background: #fff6e8;
  color: #9a6b10;
}

.insight-sev-badge.ok {
  background: #eaf7ef;
  color: #207a4f;
}

.insight-text {
  margin: 0 0 10px;
  font-size: 14px;
  color: #2b3342;
  line-height: 1.45;
}

.insight-reco {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
  padding-top: 10px;
  border-top: 1px solid #e8ecf4;
}

.insight-reco strong {
  color: #374151;
}

.insight-history-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: #4b5563;
}

.analytics-chart-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #667085;
}

.analytics-chart-title:not(:first-child) {
  margin-top: 16px;
}

.analytics-inline-insight {
  margin: 10px 0 0;
  font-size: 13px;
  color: #384152;
  padding: 10px 12px;
  background: #f4f6fb;
  border-radius: 8px;
  border: 1px solid #e5eaf3;
}

.analytics-reco-inline {
  margin: 10px 0 0;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.45;
  padding: 10px 12px;
  background: #fbfcff;
  border-radius: 8px;
  border: 1px solid #e5eaf3;
  border-left: 3px solid #8aa4d6;
}

.data-low-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #8a6408;
  background: #fff6e8;
  border: 1px solid #f2dfbe;
}

/* Столбики в аналитике: равные колонки, подпись строго под своим столбцом */
.mini-chart.analytics-chart-ro {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
  justify-items: stretch;
  gap: 6px;
  height: 172px;
  min-height: 172px;
  padding: 10px 2px 26px;
  box-sizing: border-box;
}

.mini-chart.analytics-chart-ro .bar {
  cursor: default;
  flex: initial;
  min-width: 0;
  width: 100%;
  justify-self: stretch;
}

.mini-chart.analytics-chart-ro .bar span {
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
  max-width: 100%;
  text-align: center;
  bottom: -22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-chart.analytics-chart-ro .bar i {
  left: 50%;
  transform: translateX(-50%);
}

.mini-chart.analytics-chart-ro.analytics-dense {
  gap: 4px;
}

.mini-chart.analytics-chart-ro.analytics-dense .bar span {
  font-size: 10px;
}

.mini-chart.analytics-chart-ro.analytics-dense .bar i {
  font-size: 10px;
}

.analytics-line-wrap {
  width: 100%;
  min-height: 128px;
}

.analytics-svg {
  width: 100%;
  height: 120px;
  display: block;
}

.analytics-svg polyline {
  fill: none;
  stroke: #4b6cb0;
  stroke-width: 2;
}

.analytics-svg .line-fill {
  fill: rgba(75, 108, 176, 0.08);
  stroke: none;
}

.analytics-svg .axis-label {
  font-size: 10px;
  fill: #98a2b3;
}

.load-type-bars {
  display: grid;
  gap: 12px;
  width: 100%;
}

.load-type-row {
  display: grid;
  grid-template-columns: minmax(4.25rem, auto) minmax(0, 1fr) 2.75rem;
  align-items: center;
  column-gap: 12px;
  font-size: 13px;
}

.load-type-row > span:first-child {
  line-height: 1.25;
}

.load-type-row > span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #667085;
}

.load-type-track {
  height: 10px;
  min-width: 0;
  width: 100%;
  background: #e8ecf4;
  border-radius: 999px;
  overflow: hidden;
}

.load-type-fill {
  height: 100%;
  border-radius: 999px;
}

.load-type-fill.gym {
  background: #5b7fd1;
}

.load-type-fill.field {
  background: #63a080;
}

.load-type-fill.game {
  background: #c17a5c;
}

.load-type-track [class^="load-type-fill--"] {
  background: #64748b;
}

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-table {
  border-collapse: collapse;
  font-size: 11px;
}

.heatmap-table th,
.heatmap-table td {
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #e5eaf3;
}

.heatmap-table th {
  background: #f8fafc;
  color: #667085;
  font-weight: 600;
}

.heatmap-table .hm-row-label {
  text-align: left;
  white-space: nowrap;
  color: #4b5563;
  font-weight: 500;
  background: #fafbfd;
}

.hm-cell {
  min-width: 36px;
  height: 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
}

.hm-l0 {
  background: #f1f5f9;
  color: #94a3b8;
}

.hm-l1 {
  background: #dbeafe;
  color: #1e40af;
}

.hm-l2 {
  background: #fef3c7;
  color: #92400e;
}

.hm-l3 {
  background: #fee2e2;
  color: #991b1b;
}

.trend-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.trend-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}

.trend-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #667085;
}

.trend-card .trend-val {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
}

.trend-card .trend-val.bad {
  color: var(--danger);
}

.trend-card .trend-val.good {
  color: var(--ok);
}

.plan-fact-list {
  display: grid;
  gap: 10px;
}

.plan-fact-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e5eaf3;
  border-radius: 10px;
  background: #fafbfd;
}

.plan-fact-item.bad {
  border-color: #f0c4cc;
  background: #fff8f9;
}

.plan-fact-item.ok {
  border-color: #c6e6d4;
  background: #f8fcfa;
}

.pf-label {
  font-size: 11px;
  font-weight: 700;
  color: #98a2b3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-text {
  margin: 4px 0 0;
  font-size: 13px;
  color: #374151;
}

.pf-arrow {
  font-size: 18px;
  color: #98a3b8;
  text-align: center;
  padding-top: 14px;
}

.pf-delta {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.pf-delta.bad {
  color: var(--danger);
}

.pf-delta.ok {
  color: var(--ok);
}

.individual-panel {
  display: grid;
  gap: 12px;
}

.individual-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.individual-metric {
  border: 1px solid #e5eaf3;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.individual-metric .label {
  font-size: 11px;
  color: #98a2b3;
  text-transform: uppercase;
  font-weight: 600;
}

.individual-metric .value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: #1f2937;
}

.individual-insight {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  padding: 12px;
  background: #f4f6fb;
  border-radius: 8px;
  border: 1px solid #e8ecf4;
}

.reco-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.reco-list li {
  padding: 12px 14px 12px 40px;
  border: 1px solid #dce3f0;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2ff 0 4px, #fff 4px);
  font-size: 14px;
  color: #374151;
  position: relative;
}

.reco-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4b6cb0;
}

.analytics-reco-block {
  margin-bottom: 24px;
}

/* ---------- Settings ---------- */
.settings-page .settings-lede {
  font-size: 13px;
  max-width: 720px;
  margin: 8px 0 0;
  line-height: 1.5;
}

.settings-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}

.settings-field .form-input {
  margin-top: 6px;
}

select.form-input.settings-select {
  cursor: pointer;
  appearance: auto;
}

.settings-note {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.settings-note code {
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.settings-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 18px 0 28px;
}

.settings-save-hint {
  font-size: 12px;
  color: #207a4f;
  font-weight: 600;
}

.settings-faq-block .faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 720px;
}

.settings-faq-block .faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
  overflow: hidden;
}

.settings-faq-block .faq-q {
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  padding: 12px 14px;
  padding-right: 36px;
  position: relative;
  line-height: 1.4;
}

.settings-faq-block .faq-q::-webkit-details-marker {
  display: none;
}

.settings-faq-block .faq-q::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.settings-faq-block .faq-item[open] .faq-q::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.settings-faq-block .faq-a {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  padding: 0 14px 14px;
  border-top: 1px solid #e2e8f0;
  margin-top: 0;
  padding-top: 10px;
}

.settings-faq-block .faq-a strong {
  color: #334155;
  font-weight: 600;
}

.analytics-page .status-table tbody tr {
  cursor: default;
}

.analytics-page .status-table tbody tr:hover {
  background: transparent;
}

.analytics-risk-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
}

.analytics-risk-spark span {
  width: 6px;
  border-radius: 2px;
  background: #cbd5e1;
  min-height: 4px;
}

.analytics-risk-spark span.hi {
  background: var(--danger);
}

.analytics-risk-spark span.mid {
  background: var(--warn);
}

.analytics-risk-spark span.lo {
  background: var(--ok);
}

.risk-cards {
  display: grid;
  gap: 10px;
}

.risk-card {
  border: 1px solid #e4e9f2;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafbfd;
}

.risk-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.risk-card-actions {
  margin-top: 8px;
}

.ghost-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

ul {
  margin: 8px 0 0;
  padding-left: 16px;
  color: #4b5563;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 900px) {
  html {
    overflow-x: hidden;
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Иначе остаётся «пустая» колонка 86px и контент сжимается / ломается */
  body.sidebar-collapsed .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, calc(88vw + env(safe-area-inset-left, 0px)));
    max-width: 100%;
    padding-top: max(22px, env(safe-area-inset-top, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: 14px;
    padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.28);
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .content {
    padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px));
    min-width: 0;
    max-width: 100%;
  }

  .topbar {
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px max(14px, env(safe-area-inset-right, 0px)) 12px max(14px, env(safe-area-inset-left, 0px));
    z-index: 25;
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-right .chip {
    max-width: min(200px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-right .ghost-btn {
    padding: 8px 11px;
    font-size: 12px;
  }

  .topbar-title {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    line-height: 1.25;
  }

  .panel.active {
    min-width: 0;
  }

  .dashboard-block {
    max-width: 100%;
  }

  .cards,
  .cards.compact,
  .cards.compact.cards-status-four {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-wrap {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .home-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-header h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .team-delete-hint {
    flex-basis: 100%;
    text-align: left;
    order: 3;
  }

  .dashboard-block.team-list-block .block-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .team-head-filters {
    justify-content: flex-start;
    max-width: none;
  }

  .block-head {
    flex-direction: column;
  }

  .block-controls {
    width: 100%;
  }

  .block-period,
  .collapse-btn {
    width: 100%;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .analytics-cols {
    grid-template-columns: 1fr;
  }

  .plan-fact-item {
    grid-template-columns: 1fr;
  }

  .pf-arrow {
    display: none;
  }

  .menu-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Планшеты / узкие ноутбуки: две колонки в полосе действий вместо одной */
@media (max-width: 900px) and (min-width: 520px) {
  .home-action-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .risk-score-card {
    flex-direction: column;
    align-items: stretch;
  }

  .risk-score-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .player-drawer-panel {
    width: 100%;
    max-width: none;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
      max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    border-left: none;
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
  }

  .topbar-right .ghost-btn {
    padding: 8px 9px;
    font-size: 11px;
  }
}

/* Узкий ноутбук / малый desktop: не даём боковой панели сжимать контент слишком сильно */
@media (max-width: 1100px) and (min-width: 901px) {
  .app {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .content {
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(18px, env(safe-area-inset-right, 0px));
  }

  .grid-2 {
    gap: 12px;
  }
}

.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;
}

.plan-period-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 12px 0 18px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.plan-week-month-inline {
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
}

.plan-inline-calendar-surface {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 14px 18px;
  background: var(--surface-soft);
}

.plan-week-calendar-host {
  width: 100%;
}

.plan-week-dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-align: center;
}

.plan-week-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  min-height: 420px;
}

.plan-week-day-col {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.plan-week-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.plan-week-day-num {
  font-size: 1.35rem;
  font-weight: 700;
}

.plan-week-day-month {
  font-size: 12px;
}

.plan-week-day-events {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  max-height: 680px;
  min-height: 180px;
}

.plan-cal-add-here {
  font-size: 11px;
  padding: 4px 8px;
  margin-left: auto;
}

.plan-cal-ev {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  min-width: 0;
}

.plan-cal-ev--compact {
  padding: 4px;
  margin-bottom: 4px;
  font-size: 11px;
}

.plan-cal-ev-line {
  font-weight: 500;
}

.plan-cal-ev-sub {
  font-size: 10px;
  line-height: 1.25;
}

.plan-cal-ev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.plan-cal-ev-btn {
  font-size: 11px;
  padding: 2px 6px;
}

.plan-month-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 10px;
  text-align: center;
}

.plan-month-dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-align: center;
}

.plan-month-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.plan-month-cell {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  min-height: 84px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding: 2px;
}

.plan-month-cell--pad {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
  min-height: 0;
}

.plan-month-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  gap: 4px;
}

.plan-month-day-num {
  font-weight: 700;
  font-size: 13px;
}

.plan-cal-add-month {
  min-width: 28px;
  padding: 2px 6px;
  font-weight: 700;
  font-size: 13px;
}

.plan-month-cell-events {
  flex: 1;
  overflow-y: auto;
  max-height: 112px;
  padding: 0 2px 4px;
}

@media (max-width: 900px) {
  .plan-week-day-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .plan-week-dow-row {
    display: none;
  }

  .plan-week-day-col {
    min-height: 120px;
  }

  .plan-month-cells {
    grid-template-columns: repeat(7, minmax(0, 32px));
    font-size: 10px;
  }

  .plan-month-cell {
    min-height: 64px;
  }
}

.plan-period-modes {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
}

.plan-period-modes .plan-period-mode {
  font-size: 13px;
  padding: 8px 14px;
}

.plan-period-modes:not(.plan-view-segmented) .plan-period-mode.active {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.45);
  color: var(--text);
}

.plan-period-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px 6px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.plan-period-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 0;
  text-align: center;
  flex: 1 1 8rem;
  max-width: min(100%, 22rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-cal-arrow {
  min-width: 34px;
  flex-shrink: 0;
  padding-left: 6px;
  padding-right: 6px;
}

#planCalToday {
  flex-shrink: 0;
  white-space: nowrap;
}

.plan-table-section-title {
  margin: 20px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.plan-period-inline-label {
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 520px) {
  .plan-period-nav-row .plan-period-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .plan-period-nav-row .plan-period-label {
    flex: 1 1 100%;
    max-width: none;
    order: -1;
  }
}

.plan-day-events-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.plan-day-events-head h3 {
  margin: 0;
}

.plan-focus-date-label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.plan-focus-date-input {
  max-width: 11rem;
  font-size: 14px;
  padding: 8px 10px;
}

.plan-events-table-wrap {
  min-height: 10rem;
}

.plan-title-label-wrap {
  display: block;
}

/* Модалка «Добавить игрока» (Telegram / сайт) */
.add-player-modal {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.add-player-modal[hidden] {
  display: none !important;
}

.add-player-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.55);
}

.add-player-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  padding: 1.15rem 1.2rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, rgba(28, 32, 42, 0.98), rgba(18, 20, 28, 0.99));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.add-player-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.add-player-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(232, 234, 239, 0.68);
}

.add-player-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.add-player-modal__actions .ghost-btn {
  width: 100%;
  justify-content: center;
}

.add-player-modal__close {
  width: 100%;
  justify-content: center;
  margin-top: 0.15rem;
}

.onboarding-demo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 1.25rem 1rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(34, 197, 94, 0.08));
}

.onboarding-demo-banner[hidden] {
  display: none !important;
}

.onboarding-demo-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(232, 234, 239, 0.88);
  max-width: 46rem;
}

.onboarding-demo-banner__text strong {
  font-weight: 600;
  color: #e8eaef;
}

.onboarding-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  pointer-events: none;
}

.onboarding-tour-overlay[hidden] {
  display: none !important;
}

.onboarding-tour-spotlight {
  position: fixed;
  z-index: 3998;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 12px;
  border: 2px solid rgba(165, 180, 252, 0.95);
  box-shadow: 0 0 0 9999px rgba(8, 10, 16, 0.45);
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease, opacity 0.2s ease;
}

.onboarding-tour-spotlight[hidden] {
  opacity: 0;
  pointer-events: none;
}

.onboarding-tour-card {
  position: fixed;
  z-index: 4001;
  width: min(20.5rem, calc(100vw - 1.5rem));
  max-height: min(46vh, 20rem);
  overflow: auto;
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: linear-gradient(165deg, rgba(24, 26, 36, 0.98), rgba(18, 20, 30, 0.99));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.onboarding-tour-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.onboarding-tour-progress {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.95);
}

.onboarding-tour-skip {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
}

.onboarding-tour-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: #f1f5f9;
}

.onboarding-tour-body {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.9);
}

.onboarding-tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.onboarding-tour-actions .ghost-btn {
  min-height: 2.25rem;
}

.onboarding-tour-actions .primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
