/* Fonts Local Hosting (Variable Fonts) */
@font-face {
  font-family: "Jura";
  src: url("../fonts/Jura/Jura-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope/Manrope-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/SpaceGrotesk/SpaceGrotesk-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf")
    format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg-1: #0b1220;
  --bg-2: #020617;
  --bg-dark: #11141d;
  --fg: #e2e8f0;
  --fg-strong: #f8fafc;
  --fg-muted: #94a3b8;
  --muted: rgba(255, 255, 255, 0.06);
  --muted-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-2: rgba(255, 255, 255, 0.2);
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.08);
  --accent-from: #f43f5e;
  --accent-to: #f59e0b;
  --accent-grad: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  --accent-grad-vert: linear-gradient(
    176.35deg,
    var(--accent-from),
    var(--accent-to)
  );
  --green: #22c55e;
  --green-2: #16a34a;
  --ok: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --container: 80rem;
  --header-h: 56px;
  --control-h: 48px;
  --control-h-sm: 40px;

  /* Updated Radius */
  --radius: 16px;
  --radius-btn: 12px;
  --radius-input: 12px;

  /* Fonts */
  --font-head:
    "Jura", "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  --font-body:
    "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;

  --grid-o: 0.05; /* прозрачность сетки */
  color-scheme: dark;
  --formula-o: 0.1;
  --formula-color: #fff;
  --formula-blend: overlay;
  --grid-o: 0.05; /* базовая видимость в тёмной теме */
  --grid-color: rgba(255, 255, 255, 0.9); /* белые линии для тёмной темы */
  --grid-size: 32px;

  /* DESIGN SYSTEM: Canonical Spacing & Rhythm */
  --space-xs: 0.5rem;   /* 8px */
  --space-sm: 0.75rem;  /* 12px */
  --space-md: 1rem;     /* 16px */
  --space-lg: 1.5rem;   /* 24px */
  --space-xl: 2.5rem;   /* 40px */
  --space-2xl: 4rem;    /* 64px */

  /* Glassmorphism Canon */
  --glass-bg: color-mix(in oklab, var(--bg-1) 85%, transparent);
  --glass-border: var(--border);
  --glass-blur: blur(12px);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px -5px var(--accent-from);
}

/* Base Component Styles (Canon) */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.card-accent-top {
  position: relative;
  overflow: hidden;
}
.card-accent-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-grad);
  z-index: 1;
}

/* Adaptive Grids */
.adaptive-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.kpi-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

[hidden] {
  display: none !important;
}

:root[data-theme="light"] {
  --grid-o: 0.1; /* делаем заметнее на светлом */
  --grid-color: rgba(2, 6, 23, 0.65);
  --bg-dark: #ffffff;
  --bg-1: #f6f7fb;
  --bg-2: #ffffff;
  --fg: #0b1220;
  --fg-strong: #020617;
  --fg-muted: #4b5563;
  --muted: rgba(0, 0, 0, 0.06);
  --muted-2: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.1);
  --border-2: rgba(0, 0, 0, 0.2);
  --card: rgba(0, 0, 0, 0.04);
  --card-border: rgba(0, 0, 0, 0.08);
  --line: rgba(2, 6, 23, 0.08);
  --grid-o: 0.08;
  color-scheme: light;
  --formula-o: 0.16; /* чуть заметнее на светлом фоне */
  --formula-color: #334155; /* тёмно-серый вместо белого */
  --formula-blend: multiply; /* лучше «приклеивается» к светлому фону */
  --grid-o: 0.04;
}
#themeToggle svg {
  display: block;
}
#themeToggle .sun {
  display: none;
}
[data-theme="light"] #themeToggle .sun {
  display: block;
}
[data-theme="light"] #themeToggle .moon {
  display: none;
}
body,
.header,
.card,
.drawer__panel,
.modal__panel {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}
/* Стилизация скроллбара */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-from);
}

html,
body {
  overflow: auto;
  -ms-overflow-style: none; /* IE/старый Edge */
  scrollbar-width: none; /* Firefox */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome/Safari/новый Edge */
}

/* Скрыть горизонтальный скролл у карусели */
.hscroll {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
.hscroll::-webkit-scrollbar {
  /* Chrome/Safari/Edge */
  height: 0;
  display: none;
}
.hscroll::-webkit-scrollbar-track {
  background: transparent;
}
.hscroll::-webkit-scrollbar-thumb {
  background: transparent;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at top, rgba(244, 63, 94, 0.2), transparent 45%),
    radial-gradient(
      ellipse at bottom,
      rgba(251, 191, 36, 0.2),
      transparent 50%
    ),
    linear-gradient(var(--bg-2), var(--bg-1) 55%, var(--bg-2));
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--header-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

#landing-view {
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

/* GRID overlay */
.grid {
  opacity: var(--grid-o);
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* HEADER */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 1000;
  backdrop-filter: saturate(1.1) blur(8px);
  background: color-mix(in oklab, var(--bg-2) 75%, transparent);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--fg-strong);
}
.brand__chip {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: var(--bg-1);
  background-image: linear-gradient(
    135deg,
    var(--accent-from),
    var(--accent-to)
  );
}
.brand__text {
  letter-spacing: 0.02em;
}
.nav {
  display: none;
  gap: 24px;
  color: color-mix(in oklab, var(--fg), #fff 5%);
}
.nav__link {
  font-size: 14px;
  transition: color 0.2s ease;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-h);
  border-radius: var(--radius-btn);
  padding: 10px 18px; /* Чуть шире */
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--fg);
  transition: all 0.2s ease;
  font-weight: 600;
}
.btn--sm {
  min-height: var(--control-h-sm);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
}
.btn--muted {
  background: var(--muted);
  border-color: var(--border);
}

.btn--accent {
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  color: #0b1220;
  font-weight: 800;
  border: none;
  display: inline-flex; /* Fix flex alignment */
  justify-content: center;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
  font-family: var(--font-body);
}

.btn--icon-only {
  padding: 10px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 40px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--muted);
}

#headerLoginBtn.is-hidden {
  display: none;
}
.i {
  display: block;
}

/* DRAWER */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-columns: 1fr;
  pointer-events: none;
}
.drawer[hidden] {
  display: none;
}
.drawer__backdrop {
  grid-row: 1;
  grid-column: 1;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer__panel {
  grid-row: 1;
  grid-column: 1;
  justify-self: end;
  width: min(92vw, 360px);
  height: 100vh;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  transform: translateX(102%);
  transition: transform 0.28s;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer--open .drawer__backdrop {
  opacity: 1;
  pointer-events: auto;
}
.drawer--open .drawer__panel {
  transform: translateX(0);
  pointer-events: auto;
}
.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: color-mix(in oklab, var(--bg-1) 92%, transparent);
  border-bottom: 1px solid var(--border);
}
.drawer__user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--muted-2);
  font-weight: 800;
}
.drawer__close {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.drawer__link {
  padding: 12px;
  border-radius: 12px;
  background: var(--muted);
  border: 1px solid var(--border);
}

/* SIDE DOTS */
.side-nav {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: none;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.side-nav__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, #fff 20%, transparent);
  background: var(--muted);
  transition:
    transform 0.2s,
    background 0.2s;
}

.side-nav__dot.active {
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  border-color: transparent;
}
.side-nav__dot::after {
  content: attr(data-label);
  position: absolute;
  right: 150%;
  white-space: nowrap;
  background: color-mix(in oklab, var(--bg-2) 90%, transparent);
  color: var(--fg);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.side-nav__dot:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* HERO */
.hero {
  position: relative;
  max-width: 100%;
  overflow-x: hidden;
}
.hero__stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  min-height: calc(var(--vh, 1vh) * 100);
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding-top: 28px;
  contain: paint;
}
.hero__inner {
  display: grid;
  gap: 18px;
  justify-items: center;
  width: 100%;
  min-width: 0;
  max-width: min(1100px, 100%);
  padding-inline: 16px;
  padding-block: 64px;
}
.card--all {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  min-height: 220px; /* чтобы по высоте не отличалась */
}

button.row--cta {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button.card--all {
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  /* background: transparent; */
}
.card--all .cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 900;
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  color: #0b1220;
  border: none;
}
.card--all .desc {
  font-size: 14px;
  color: var(--fg-muted);
}
.card--all svg {
  display: block;
}

.word {
  display: block;
  justify-self: stretch;
  overflow: hidden;
  font-family: Roboto, Ubuntu, Cantarell, "Noto Sans", Helvetica, Arial;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  font-size: clamp(64px, 16vw, 220px);
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  background-size: 200% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.35));
  animation:
    breathe 4s ease-in-out infinite,
    gloss 3.5s ease-in-out infinite;
}
@keyframes breathe {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes gloss {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.tagline {
  font-size: clamp(14px, 2.6vw, 18px);
  color: var(--fg-muted);
}

/* Formulas in HERO only */
.formulas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.1;
}
.formulas span {
  position: absolute;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #fff;
  font-weight: 700;
  mix-blend-mode: overlay;
  opacity: 0.9;
  transform: rotate(var(--rot, 0deg));
  white-space: nowrap;
}
.formulas .f1 {
  left: 6%;
  top: 20%;
  font-size: 28px;
  --rot: -14deg;
}
.formulas .f2 {
  right: 4%;
  top: 18%;
  font-size: 22px;
  --rot: 8deg;
}
.formulas .f3 {
  left: 22%;
  top: 60%;
  font-size: 26px;
  --rot: -8deg;
}
.formulas .f4 {
  right: 6%;
  top: 64%;
  font-size: 24px;
  --rot: 12deg;
}
.formulas .f5 {
  left: 40%;
  top: 34%;
  font-size: 20px;
  --rot: -6deg;
}
.formulas .f6 {
  left: 12%;
  top: 72%;
  font-size: 18px;
  --rot: 5deg;
}
.formulas .f7 {
  right: 4%;
  top: 42%;
  font-size: 19px;
  --rot: -10deg;
}
.formulas .f8 {
  left: 52%;
  top: 76%;
  font-size: 17px;
  --rot: 7deg;
}
.formulas .f9 {
  left: 30%;
  top: 16%;
  font-size: 21px;
  --rot: -4deg;
}
.formulas .f10 {
  right: 2%;
  top: 28%;
  font-size: 18px;
  --rot: 9deg;
}

/* Sections */
.section {
  padding-block: 56px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: color-mix(in oklab, var(--fg), #fff 5%);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
}
.section__title {
  font-size: clamp(22px, 3vw, 36px);
  color: var(--fg-strong);
  font-weight: 700;
  font-family: var(--font-head);
  margin: 8px 0;
}
.accent-bar {
  height: 4px;
  width: 110px;
  border-radius: 999px;
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  margin-top: 6px;
  margin-bottom: 10px;
}
.lead {
  margin-top: 12px;
  color: color-mix(in oklab, var(--fg), #fff 5%);
  line-height: 1.75;
}

/* WHAT */
.what__title {
  font-family: var(--font-head);
  font-size: clamp(26px, 4.6vw, 40px);
  font-weight: 900;
  color: var(--fg-strong);
  margin: 6px 0;
}
.feature-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: color-mix(in oklab, var(--bg-1) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
}
.feature-card + .feature-card {
  margin-top: 10px;
}
.feature-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background-image: linear-gradient(
    135deg,
    var(--accent-from),
    var(--accent-to)
  );
}
.feature-card__title {
  font-weight: 700;
  color: var(--fg-strong);
  font-family: var(--font-head);
}
.feature-card__sub {
  font-size: 14px;
  color: color-mix(in oklab, var(--fg), #fff 10%);
}
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  color: var(--fg-muted);
}
.note__icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--muted);
  border: 1px solid var(--border);
}

/* Horizontal tournaments */
.hscroll-wrap {
  position: relative;
}
.hscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block: 6px;
}
.hscroll > * {
  scroll-snap-align: start;
}

.hscroll__controls {
  position: absolute;
  inset: auto 0 100% 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 8px;
}
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-view-anim] {
  animation: fadeInDown 0.4s cubic-bezier(0, 0, 0.2, 1) both;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.ops-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.ops-panel--primary {
  padding: var(--space-xl);
}

.ops-panel--nested {
  background: color-mix(in oklab, var(--bg-1) 40%, transparent);
  padding: var(--space-md);
}

.ops-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.ops-panel__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-strong);
}
.card__topbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
}
.card__head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: color-mix(in oklab, var(--fg), #fff 5%);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}
.status--soon {
  color: #fde68a;
  background: rgba(253, 230, 138, 0.1);
  border-color: rgba(253, 230, 138, 0.3);
}
.status--live {
  color: #86efac;
  background: rgba(134, 239, 172, 0.1);
  border-color: rgba(134, 239, 172, 0.3);
}
.status--ended {
  color: #cbd5e1;
  background: rgba(203, 213, 225, 0.08);
  border-color: rgba(203, 213, 225, 0.3);
}
.card__title {
  color: var(--fg-strong);
  font-weight: 800;
  font-size: 18px;
  margin: 0;
  font-family: var(--font-head);
}
.card__sub {
  margin: 4px 0 0;
  color: color-mix(in oklab, var(--fg), #fff 5%);
  font-size: 14px;
}
.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  color: color-mix(in oklab, var(--fg), #fff 5%);
  font-size: 14px;
  flex-wrap: wrap;
}
.card__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* TOP players (с круглыми номерами) */
.board {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in oklab, var(--bg-1) 85%, transparent);
  overflow: hidden;
}
.row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  min-height: 89px;
}
.row:first-child {
  border-top: none;
}
/* кружки 1–3 как на скрине */
.rankchip {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 18px;
  color: #0b1220;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.rankchip--1 {
  background-image: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.rankchip--2 {
  background-image: linear-gradient(135deg, #e5e7eb, #94a3b8);
  color: #0f172a;
}
.rankchip--3 {
  background-image: linear-gradient(135deg, #f97316, #ea580c);
}
.rankchip--n {
  background: var(--muted);
  color: var(--fg);
}
/* аватар-инициалы */
.badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  font-weight: 800;
  color: var(--fg-strong);
}
.row__mid {
  display: grid;
}
.row__name {
  font-weight: 900;
  color: var(--fg-strong);
}
.row__sub {
  font-size: 13px;
  color: color-mix(in oklab, var(--fg), #fff 10%);
}
.row__right {
  display: grid;
  gap: 4px;
  justify-items: end;
}
.score {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--green) 22%, transparent),
    color-mix(in oklab, var(--green-2) 18%, transparent)
  );
  border: 1px solid color-mix(in oklab, var(--green) 40%, transparent);
  font-weight: 900;
  color: #d1fae5;
  min-width: 96px;
  text-align: center;
}
.wins {
  font-size: 13px;
  color: color-mix(in oklab, var(--fg), #fff 12%);
}
.topbar-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: 18px;
  padding: 8px 12px;
  color: color-mix(in oklab, var(--fg), #fff 6%);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* FOOTER */
.footer {
  margin-top: 32px;
  margin-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-2) 75%, transparent);
}
.footer__grid {
  display: grid;
  gap: 16px;
  padding: 24px 0;
  padding-left: 10px;
  padding-right: 10px;
}

.footer__brand {
  font-weight: 800;
  color: var(--fg-strong);
  font-size: 18px;
}
.footer__text {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 14px;
}
.footer__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.footer__link {
  color: var(--fg);
  opacity: 0.9;
}
.footer__copy {
  margin-top: 10px;
  color: var(--fg-muted);
  font-size: 14px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
}
.modal[hidden] {
  display: none;
}
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal__panel {
  position: relative;
  width: min(92vw, 440px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 16px;
  transform: translateY(10px);
  opacity: 0;
  transition:
    transform 0.2s,
    opacity 0.2s;
}
.modal--open .modal__backdrop {
  opacity: 1;
}
.modal--open .modal__panel {
  opacity: 1;
  transform: translateY(0);
}
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal__title {
  font-weight: 800;
  color: var(--fg-strong);
  font-size: 18px;
}
.modal__close {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.modal__body {
  display: grid;
  gap: 10px;
}
.modal__note {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 6px;
}

/* OAuth icon buttons */
.oauth-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.oauth-divider > span:first-child,
.oauth-divider > span:last-child {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.oauth-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.oauth-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.oauth-icon-btn:hover:not(:disabled) {
  background: var(--muted-2);
  border-color: var(--fg-muted);
  transform: translateY(-1px);
}
.oauth-icon-btn:active:not(:disabled) {
  transform: translateY(0);
}
.oauth-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.vk-id-widget-wrap {
  position: relative;
  overflow: hidden;
  padding: 0;
}
.vk-id-widget-wrap::before {
  content: "VK";
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #0077ff;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.08em;
  pointer-events: none;
}
.vk-id-widget-wrap > * {
  position: absolute !important;
  inset: 0 !important;
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  opacity: 0 !important;
}
.vk-id-widget-wrap iframe,
.vk-id-widget-wrap button {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
}

/* Cookie notice */
.cookie-notice {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 2600;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in oklab, var(--bg-1) 92%, transparent);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}
.cookie-notice__copy {
  display: grid;
  gap: 4px;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
}
.cookie-notice__copy strong {
  color: var(--fg-strong);
  font-size: 14px;
}
.cookie-notice__copy a {
  color: var(--fg-strong);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--fg-strong) 45%, transparent);
}
.cookie-notice__btn {
  flex-shrink: 0;
  min-width: 112px;
  justify-content: center;
}

@media (max-width: 640px) {
  .header__inner {
    padding-inline: 20px;
  }

  .brand {
    min-width: 0;
  }

  .cookie-notice {
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .word {
    font-size: min(14.5vw, 86px);
  }
  .cookie-notice__btn {
    width: 100%;
  }
}

.document-page {
  min-height: 100vh;
  padding-top: 0;
}

.doc-shell {
  position: relative;
  min-height: 100vh;
}

.doc-hero {
  padding: 72px 0 24px;
}

.doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--fg-muted);
  background: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-title {
  margin: 18px 0 12px;
  font-family: var(--font-head);
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.96;
  color: var(--fg-strong);
}

.doc-subtitle {
  max-width: 760px;
  color: var(--fg-muted);
  font-size: 18px;
  line-height: 1.65;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 40px;
}

.doc-sidecard,
.doc-card {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.18);
}

.doc-sidecard {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 20px;
}

.doc-sidecard h2,
.doc-card h2,
.doc-card h3 {
  margin: 0 0 12px;
  color: var(--fg-strong);
}

.doc-sidecard p,
.doc-sidecard li,
.doc-card p,
.doc-card li {
  color: var(--fg-muted);
  line-height: 1.7;
}

.doc-sidecard ul,
.doc-card ul {
  margin: 0;
  padding-left: 20px;
}

.doc-card {
  padding: 28px;
}

.doc-card + .doc-card {
  margin-top: 18px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  background: var(--muted);
  color: var(--fg);
  font-size: 14px;
}

.doc-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.doc-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--fg-strong);
  text-decoration: none;
}

.doc-link-btn--accent {
  background: var(--accent-grad);
  border-color: transparent;
  color: white;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidecard {
    position: static;
  }
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}
.formulas {
  opacity: var(--formula-o);
}
.formulas span {
  color: var(--formula-color);
  mix-blend-mode: var(--formula-blend);
}
@supports (-webkit-text-stroke: 1px black) {
  /* тонкий контур на светлой теме — ещё +читабельность */
  [data-theme="light"] .formulas span {
    -webkit-text-stroke: 0.4px rgba(0, 0, 0, 0.06);
  }
}

/* -------- 2) Контраст статусов (жёлтый/зелёный/серый) -------- */
[data-theme="light"] .status--soon {
  color: #a16207; /* тёмный янтарный (AA) */
  background: #fef3c7; /* светло-жёлтая подложка */
  border-color: #f59e0b33;
}
[data-theme="light"] .status--live {
  color: #166534; /* тёмный зелёный (AA) */
  background: #dcfce7; /* светло-зелёная подложка */
  border-color: #16a34a33;
}
[data-theme="light"] .status--ended {
  color: #374151; /* графитовый текст */
  background: #f3f4f6; /* нейтральная подложка */
  border-color: #94a3b833;
}

/* -------- 3) «Очки» в топе — сделать читаемыми на светлом -------- */
[data-theme="light"] .score {
  background: #bbf7d0; /* монолитная светло-зелёная, без градиента */
  color: #065f46; /* тёмный текст для контраста */
  border: 1px solid #34d399;
  text-shadow: none;
}

/* -------- 4) Нейтральные элементы (серые) чуть темнее -------- */
[data-theme="light"] .badge {
  background: #eef2f7;
  color: #0b1220;
  border-color: #cbd5e1;
}
[data-theme="light"] .board {
  border-color: #e5e7eb;
}
[data-theme="light"] .row {
  border-top-color: #e5e7eb;
}
/* Кнопка-плитка "Все турниры" — аккуратный вид */
.card--all {
  position: relative;
  display: grid;
  place-items: center;
  justify-items: center;
  min-height: 200px;
  width: 244px;
  padding-right: 80px;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: transparent;
  background-image:
    radial-gradient(
      120% 120% at 0% 0%,
      rgba(255, 255, 255, 0.18),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      var(--accent-from) 0%,
      #f97316 60%,
      var(--accent-to) 100%
    );
  color: #0b1220;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}
.card--all .card__topbar {
  display: none;
}
.card--all .label {
  font-weight: 900;
  font-size: clamp(18px, 2.6vw, 22px);
  letter-spacing: 0.01em;
}
.card--all .arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #0b1220;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.card--all:active {
  transform: translateY(0) scale(0.98);
  filter: saturate(0.98);
}

/* корректировки для тёмной/светлой темы */
:root[data-theme="light"] .card--all {
  border-color: rgba(0, 0, 0, 0.08);
}
:root:not([data-theme="light"]) .card--all {
  border-color: rgba(255, 255, 255, 0.12);
}
:root {
  --btn-float: 2px; /* подъём при hover */
  --btn-press-bright: 0.98; /* затемнение при active */
  --btn-press-sat: 0.98;
}

/* Какие элементы считаем кнопками */
.btn,
.topbar-btn,
.drawer__link,
.drawer__close,
.modal__close,
#burger,
#drawerClose,
#modalClose {
  position: relative;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
  will-change: transform, filter;
}

.btn:active,
.topbar-btn:active,
.drawer__link:active,
.drawer__close:active,
.modal__close:active,
#burger:active,
#drawerClose:active,
#modalClose:active,
.btn--hero:active {
  transform: translateY(0) scale(0.96) !important;
  filter: brightness(var(--btn-press-bright)) saturate(var(--btn-press-sat));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Фокус-кольцо для клавиатуры */
.btn:focus-visible,
.topbar-btn:focus-visible,
.drawer__link:focus-visible,
.drawer__close:focus-visible,
.modal__close:focus-visible,
#burger:focus-visible,
#drawerClose:focus-visible,
#modalClose:focus-visible,
.btn--hero:focus-visible {
  outline: 3px solid color-mix(in oklab, #fff 75%, var(--accent-to));
  outline-offset: 2px;
  border-color: transparent;
}
/* Уважение prefers-reduced-motion — делаем движения мягче */

/* герой-зона занимает экран МИНУС фиксированный хэдэр */
.hero__stage {
  position: sticky;
  top: 0;
  min-height: 100svh;
  margin-top: -55px;
  display: grid;
  place-items: center;
  padding: 0;
}

/* внутренний контейнер — компактные отступы и центр текста */
.hero__inner {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  padding: clamp(12px, 3vw, 24px);
  margin: 0 auto;
  width: 100%;
  max-width: min(1100px, 100%);
  min-width: 0;
}
/* hero-кнопка: сочный градиент, мягкая тень, блик */
.btn--hero {
  position: relative;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 900;
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  color: #0b1220;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
  margin-top: 20px;
}
.btn--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.28),
    transparent 42%
  );
  pointer-events: none;
}

/* ===== Drawer 2.0 ===== */
.drawer__panel {
  background: color-mix(in oklab, var(--bg-1) 92%, transparent);
}
/* верхняя плашка с мягкой линией */
.drawer__top {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-1) 96%, transparent);
}

/* usercard c градиентным кольцом */
.drawer__usercard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.avatar--ring {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--muted);
}
.avatar--ring::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 180deg, var(--accent-from), var(--accent-to));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
}
.user-meta {
  display: grid;
  line-height: 1.2;
}
.user-name {
  font-weight: 800;
  color: var(--fg-strong);
}
.user-role {
  font-size: 12px;
  color: var(--fg-muted);
}

/* группы меню */
.drawer__group {
  padding: 10px 16px;
}
.drawer__label {
  font-size: 12px;
  color: var(--fg-muted);
  margin: 0 0 8px 2px;
}

/* пункт меню как мини-карточка */
.drawer__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--muted);
  border: 1px solid var(--border);
  transition:
    transform 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease;
}
.drawer__item + .drawer__item {
  margin-top: 10px;
}

.drawer__item:active {
  transform: translateY(0) scale(0.99);
}
.drawer__item .left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drawer__item .ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #0b1220;
  background-image: linear-gradient(
    135deg,
    var(--accent-from),
    var(--accent-to)
  );
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.5);
}
.drawer__item .chev {
  opacity: 0.7;
}

/* нижние экшены */
.drawer__actions {
  padding: 8px 16px 16px;
  display: grid;
  gap: 10px;
  margin: auto 0;
}
.btn--block {
  width: 100%;
  justify-content: center;
}

/* тоньше скролл у панели, без полос на iOS */
.drawer__panel {
  overscroll-behavior: contain;
}
/* 1) Панель без прокрутки и полос */
.drawer__panel {
  height: 100svh;
  max-height: 100svh;
  overflow: hidden; /* убираем скролл внутри панели */
  scrollbar-width: none;
}
.drawer__panel::-webkit-scrollbar {
  display: none;
}

/* 2) Топ меню: юзер слева, иконки справа */
.drawer__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-1) 96%, transparent);
}
.drawer__usercard {
  flex: 1;
  padding: 0;
} /* тянем влево */
.drawer__right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 3) Прячем «Навигация» */
.drawer__label {
  display: none;
}

/* 4) Иконка темы как в хедере */
#themeToggleDrawerIcon svg {
  display: block;
}
#themeToggleDrawerIcon .sun {
  display: none;
}
[data-theme="light"] #themeToggleDrawerIcon .sun {
  display: block;
}
[data-theme="light"] #themeToggleDrawerIcon .moon {
  display: none;
}

/* 5) На всякий случай — убрать скролл у самого списка */
.drawer__nav {
  overflow: hidden;
}

/* (необязательно) если оставалась нижняя кнопка темы — скрыть */
.drawer__actions [data-role="theme-btn"] {
  display: none;
}
/* Тюним открытие/закрытие */
:root {
  --tr-open: cubic-bezier(0.22, 1, 0.36, 1);
  --tr-close: cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer__panel {
  transform: translateX(102%);
  transition:
    transform 0.34s var(--tr-open),
    opacity 0.2s ease;
}
.drawer__backdrop {
  opacity: 0;
  transition: opacity 0.22s ease;
}

/* открыто */
.drawer--open .drawer__panel {
  transform: translateX(0);
  opacity: 1;
}
.drawer--open .drawer__backdrop {
  opacity: 1;
}

/* плавное закрытие (отдельный тайминг) */
.drawer--closing .drawer__panel {
  transform: translateX(102%);
  transition:
    transform 0.3s var(--tr-close),
    opacity 0.2s ease;
}
.drawer--closing .drawer__backdrop {
  opacity: 0;
}

/* прячем верхнюю кнопку "Полный рейтинг" в секции #top */
#top .topbar-btn {
  display: none;
}
/* CTA внизу рейтинга — в стилистике списка */
.row--cta {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 0;
  width: 100%;
  padding: 22px 14px 20px;
  min-height: 88px;
  border-top: 1px solid var(--border);
  background: transparent;
}

/* внутренняя "кнопка" */
.row--cta .chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-inline: auto;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0.01em;
  background-image: linear-gradient(
    135deg,
    var(--accent-from),
    var(--accent-to)
  );
  color: #0b1220;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

/* кружок со стрелкой — как у "Все турниры" */
.row--cta .arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.18);
}
:root:not([data-theme="light"]) .row--cta .arrow {
  background: rgba(255, 255, 255, 0.92);
  color: #0b1220;
}
:root[data-theme="light"] .row--cta .arrow {
  background: rgba(255, 255, 255, 0.92);
  color: #0b1220;
}

/* ховер/нажатие — такие же жесты, как у остальных кнопок */
.row--cta:hover .chip {
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: #fff;
}
.row--cta:active .chip {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.98);
}

/* безопасность для маленьких экранов — пусть "пилюля" не выходит за края */

/* не двигаем всю строку CTA */
.row--cta,
.row--cta:hover,
.row--cta:active {
  transform: none !important;
}

/* анимация только у самой кнопки внутри */
.row--cta .chip {
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
  will-change: transform;
}
.row--cta:hover .chip {
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.row--cta:active .chip {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.98);
}

/* ===== Qubit extras: modals/forms/checkbox/links/disabled/eyes & drawer flash fix ===== */
:root {
  --field-bg-dark: rgba(255, 255, 255, 0.08);
  --field-bg-light: rgba(255, 255, 255, 0.78);
  --field-br: 12px;
  --ring: color-mix(in oklab, #fff 75%, var(--accent-to));
}

/* =========================================
   7. WORKSPACE LAYOUT
   ========================================= */

#workspace-view {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--fg-muted) 35%, transparent) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--fg-muted) 28%, transparent);
  border-radius: 999px;
}

.sidebar__brand {
  padding: 24px 24px 40px; /* More space bottom */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Updated Brand Text */
/* Brand Text - Global */
.brand__text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 300;
  line-height: 28px;
  color: var(--fg-strong);
  letter-spacing: 0;
}

.sidebar__nav {
  padding: 0 24px; /* Align with brand */
  display: flex;
  flex-direction: column;
  gap: 12px; /* Increased gap */
}

/* Updated Nav Item */
/* Updated Nav Item */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  padding: 10px 16px;
  gap: 16px;
  border-radius: 16px;

  font-family: var(--font-body);
  font-size: 16px;
  color: #888899;
  font-weight: 500;

  transition: all 0.2s ease;
  border: 1px solid transparent;
  z-index: 0;
}

/* Inactive Hover: Full Gradient Fill, White Text, Lift */

.nav-item:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.05);
}

/* Active State: Gradient Border (Mask), Gradient Text */
/* Active State: Gradient Border (Mask), Gradient Text, Background Fill */
.nav-item.active {
  background: linear-gradient(
    176.35deg,
    rgba(244, 63, 94, 0.1),
    rgba(245, 158, 11, 0.1)
  );
  color: transparent; /* Gradient text via background-clip on children */
  border: 1px solid transparent; /* Handled by ::before */
}

/* Active Gradient Border Mask */
.nav-item.active::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* Active Text & Icon Gradient */
.nav-item.active span,
.nav-item.active i,
.nav-item.active .icon-svg {
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* Fallback */
}

.nav-item.active .icon-svg {
  fill: url(#navGradient) !important;
  background: none;
  background-clip: border-box;
  -webkit-text-fill-color: initial;
  color: initial;
}

/* Theme toggle */
.theme-toggle-ws {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle-ws:active {
  transform: scale(0.94);
  filter: brightness(1.1);
}
.theme-toggle-ws svg {
  display: block;
}
.theme-toggle-ws .sun {
  display: none;
}
[data-theme="light"] .theme-toggle-ws .sun {
  display: block;
}
[data-theme="light"] .theme-toggle-ws .moon {
  display: none;
}

/* CONTENT AREA */
.workspace__content {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 32px 40px;
}

body.workspace-guest-code #workspace-view {
  display: block;
}

body.workspace-guest-code .sidebar,
body.workspace-guest-code .workspace-mobile-header {
  display: none !important;
}

body.workspace-guest-code .workspace__content {
  margin-left: 0 !important;
  width: 100% !important;
  padding-top: 24px;
}

.guest-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.guest-session-bar__copy {
  display: grid;
  gap: 6px;
}

.guest-session-bar__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
}

.guest-session-bar__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg-strong);
}

.guest-session-bar__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* DASHBOARD GRID */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  grid-template-rows: auto auto;
}

.dash-board-section {
  margin-top: 24px;
}

.dash-card-button {
  width: 100%;
  border: none;
  text-align: left;
  cursor: pointer;
  appearance: none;
  background: inherit;
  color: inherit;
  font: inherit;
}

/* Top Row: Active Tournament (2 cols) | Profile (1 col) */
.dash-cell--large {
  grid-column: span 2;
}

/* WIDGETS */
.widget {
  background: var(--card); /* Slightly lighter than bg */
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.widget__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.widget__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-muted);
}

.widget__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fg-muted);
  opacity: 0.7;
}

/* Active Tournament Specifics from screenshot */
.tournament-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: auto;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--muted);
  border-radius: 12px; /* Inner boxes */
  padding: 16px;
  text-align: center;
}
.stat-box__label {
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.stat-box__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg-strong);
  font-family: var(--font-head);
}
.stat-box__value--accent {
  color: var(--green); /* e.g. +3 rank */
  font-size: 12px;
  font-weight: 500;
}

/* Profile Widget */
.profile-head {
  display: flex;
  gap: 16px;
  align-items: center;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
}
.profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-strong);
}
.profile-tag {
  font-size: 13px;
  color: var(--fg-muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 24px;
}
.p-stat {
  background: var(--muted);
  border-radius: 12px;
  padding: 12px;
}
.p-stat__label {
  font-size: 11px;
  color: var(--fg-muted);
}
.p-stat__val {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-strong);
  margin-top: 2px;
}

/* Bottom Row Widgets */
.task-widget {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.03),
      transparent 40%
    ),
    var(--card);
}
.task-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--muted);
  display: grid;
  place-items: center;
  margin: auto;
  border: 1px solid var(--border);
}
.task-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* Charts Placeholder */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  margin-top: auto;
}
.bar {
  /* flex: 1; */
  background: var(--muted);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.bar.active {
  background: linear-gradient(to top, var(--accent-from), var(--accent-to));
}

/* Drawer flash fix: overlay below panel, panel no fade */
.drawer__backdrop {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.drawer__panel {
  z-index: 2;
  opacity: 1;
  transition: transform 0.34s var(--tr-open, ease);
}
.drawer--open .drawer__backdrop {
  opacity: 0.5;
}
.drawer--open .drawer__panel {
  transform: translateX(0);
}

/* Modal panel: only slide, no initial dim */
.modal__panel {
  opacity: 1;
  transition: transform 0.28s var(--tr-open, ease);
}
.modal .modal__panel {
  transform: translateY(16px);
}
.modal--open .modal__panel {
  transform: translateY(0);
}

/* Forms */
.modal__form {
  display: grid;
  gap: 12px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 13px;
  color: var(--fg-muted);
}
.turnstile-field {
  gap: 8px;
}
.turnstile-shell {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  overflow: hidden;
}
.turnstile-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background-image: var(--accent-grad);
  pointer-events: none;
}
.turnstile-shell__label {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg-muted);
}
.turnstile-shell > [data-turnstile-slot] {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 74px;
}
.turnstile-shell > [data-turnstile-slot] > * {
  max-width: 100%;
}
.turnstile-shell iframe {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 12px;
}
.turnstile-field .error {
  min-height: 1em;
}
.input,
.textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--field-br);
  border: 1px solid var(--border);
  color: var(--fg);
  /* kak bilo nado */
  background: var(--muted);
  outline: none;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.input {
  min-height: var(--control-h);
  line-height: 1.2;
}

.textarea {
  resize: none; /* Auto-expand via JS */
  padding-bottom: 24px; /* Space for counter */
}

/* Character Counter */
.char-counter {
  font-size: 11px;
  color: var(--fg-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}
.char-counter.limit {
  color: var(--accent-from);
  font-weight: 700;
}

:root[data-theme="light"] .input,
:root[data-theme="light"] .textarea {
  background: var(--field-bg-light);
  border-color: rgba(0, 0, 0, 0.08);
}
.input::placeholder {
  color: color-mix(in oklab, var(--fg), #fff 30%);
  opacity: 0.85;
}
:root[data-theme="light"] .input::placeholder {
  color: color-mix(in oklab, var(--fg), #000 20%);
}
.input:focus {
  box-shadow: 0 0 0 3px var(--ring);
  border-color: transparent;
}
.error {
  font-size: 12px;
  color: #fecaca;
  min-height: 1em;
}
:root[data-theme="light"] .error {
  color: #b91c1c;
}

/* Checkbox with gradient */
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg);
}
.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--muted);
  display: grid;
  place-items: center;
  outline: none;
  cursor: pointer;
  transition:
    filter 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}
.checkbox input:active {
  transform: scale(0.98);
}
.checkbox input:checked {
  border-color: transparent;
  background-image: linear-gradient(
    135deg,
    var(--accent-from),
    var(--accent-to)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.checkbox input:checked::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 1);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>')
    center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>')
    center/contain no-repeat;
}

/* Buttons disabled (grey) until valid */
.btn.is-disabled,
.btn:disabled {
  filter: none;
  background: var(--muted) !important;
  color: color-mix(in oklab, var(--fg), #000 15%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 transparent !important;
  cursor: not-allowed;
}

/* Links row — компактные текстовые */
.form__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
}
.form__links a {
  color: color-mix(in oklab, var(--fg), #fff 8%);
  text-decoration: none;
}
.form__links a:hover {
  color: var(--fg-strong);
  text-decoration: underline;
}

/* Password visibility toggle */
.input-group {
  position: relative;
}
.input-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--fg);
  box-shadow: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
  will-change: transform, filter;
}
.input-toggle svg {
  display: block;
}
.input-toggle:hover {
  filter: none;
  border-color: transparent;
  color: #fff;
  transform: translateY(calc(-0.6 * var(--btn-float))) scale(1.02);
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to)) !important;
}
.input-toggle:hover .input-toggle__icon-svg,
.input-toggle:hover .input-toggle__icon-svg path {
  fill: currentColor !important;
}
.input-toggle:active {
  transform: translateY(-50%) scale(0.96);
  filter: brightness(var(--btn-press-bright)) saturate(var(--btn-press-sat));
}

/* Code inputs 8x (XXXX-XXXX) */
.code-grid {
  display: grid;
  grid-template-columns: repeat(4, 42px) 24px repeat(4, 42px);
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.team-code-grid {
  grid-template-columns: repeat(10, 42px);
}
.code-cell {
  width: 42px;
  height: 48px;
  padding: 0;
  text-align: center;
  font-weight: 900;
  font-size: 25px;
  font-family: var(--font-head);
  letter-spacing: 0.02em;
}

/* Premium Prefix styling */
.code-cell--prefix {
  background: linear-gradient(176.35deg, var(--accent-from), var(--accent-to));
  color: #fff;
  border-radius: 12px;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
  user-select: none;
  line-height: 1; /* Reset for flex centering */
}

.code-sep {
  text-align: center;
  color: var(--fg-muted);
  user-select: none;
}

/* ===== FIX v3 — 2025‑10‑05 ===== */

/* Белая стрелка внутри любых градиентных кнопок */
.btn--accent svg,
.btn--accent svg path {
  color: #fff;
  stroke: #fff;
  fill: #fff;
}

/* Глазик в одной сетке с полем — не «едет», легко кликается */
.field.input-group {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
}
.field.input-group label {
  grid-column: 1 / -1;
}
.field.input-group .input {
  grid-row: 2;
  grid-column: 1;
  min-height: var(--control-h);
  height: var(--control-h);
  padding-block: 0;
  padding-right: 12px;
}
.field.input-group .input-toggle {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  z-index: 0;
  isolation: isolate;
  top: auto;
  right: auto;
  transform: none;
  margin-left: 10px;
  width: var(--control-h);
  height: var(--control-h);
  border-radius: 12px;
  display: grid;
  place-items: center;

  /* Base style (Inactive) */
  background: var(--muted);
  border: 1px solid #2a2a30;
  color: #888899;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  box-shadow: none;
}

.input-toggle__icon-svg {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  display: block;
  color: currentColor;
  flex: 0 0 auto;
  transition:
    transform 0.15s ease,
    color 0.15s ease,
    fill 0.15s ease;
}

/* --- STATES --- */

/* 1. HOVER (Любое состояние) - Яркий фон, белая иконка */

.input-toggle::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: calc(12px - 1px);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.1), rgba(245, 158, 11, 0.1));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.input-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* 2. ACTIVE (Открыт, покой) - как в каноничном user-mode */
.input-toggle.is-active {
  border: 1px solid transparent;
  background: var(--muted);
  color: transparent;
}

.input-toggle.is-active::before {
  opacity: 1;
}

.input-toggle.is-active::after {
  opacity: 1;
}

.input-toggle.is-active:not(:hover) {
  background: var(--muted);
}

:root[data-theme="light"] .input-toggle.is-active:not(:hover) {
  background: var(--field-bg-light);
}

:root[data-theme="light"] .input-toggle.is-active::before {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.14), rgba(245, 158, 11, 0.14));
  opacity: 1;
}

.input-toggle.is-active .input-toggle__icon-svg,
.input-toggle.is-active .input-toggle__icon-svg path {
  fill: url(#navGradient) !important;
  color: transparent !important;
}

.input-toggle.is-active:active .input-toggle__icon-svg,
.input-toggle.is-active:focus .input-toggle__icon-svg,
.input-toggle.is-active:not(:hover) .input-toggle__icon-svg {
  fill: url(#navGradient) !important;
  color: transparent !important;
}

.input-toggle:active {
  transform: translateY(0);
}

.field.input-group .input-toggle:hover {
  transform: translateY(calc(-0.6 * var(--btn-float))) scale(1.02);
}

.field.input-group .input-toggle:active {
  transform: translateY(0) scale(0.96);
}

.field.input-group .input-toggle:focus-visible {
  outline: 3px solid color-mix(in oklab, #fff 75%, var(--accent-to));
  outline-offset: 2px;
}

/* Подписи об ошибках под паролями */
.field [data-error-for="pass"],
.field [data-error-for="pass2"] {
  margin-top: 4px;
  min-height: 1em;
}

/* Кнопки по умолчанию серые (disabled) */
.btn.is-disabled,
.btn:disabled {
  filter: none;
  background: var(--muted) !important;
  color: color-mix(in oklab, var(--fg), #000 15%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 transparent !important;
  cursor: not-allowed;
}

/* Модалки: панель без «вспышки» затемнения, только слайд */
.modal .modal__panel {
  transform: translateY(14px);
  opacity: 1;
}
.modal--open .modal__panel {
  transform: translateY(0);
}

/* Вход по коду — не вылезает ни текст, ни кнопка */
#codeModal .modal__panel {
  max-width: min(600px, 96vw);
  padding: 16px 18px;
}
.code-grid {
  justify-content: center;
}

/* Drag‑scroll для карусели + без выделения текста при перетаскивании */
.hscroll {
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.hscroll.dragging {
  cursor: grabbing;
}
.hscroll * {
  user-select: none;
  -webkit-user-drag: none;
}

.modal__panel--code {
  width: auto;
}

.btn-nav {
  background-image: linear-gradient(
    135deg,
    var(--accent-from),
    var(--accent-to)
  );
  margin-top: 20px !important;
}

/* =========================================
   6. RESEND BUTTON & MOBILE FIXES (325px)
   ========================================= */

.btn--resend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: not-allowed;
  transition: all 0.2s ease;
  padding: 10px 14px;
  border-radius: 12px;
}

.btn--resend.is-active {
  background-image: linear-gradient(
    90deg,
    var(--accent-from),
    var(--accent-to)
  );
  color: #fff;
  cursor: pointer;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.verify__note {
  margin-top: 0 !important;
}

.hscroll > * {
  scroll-snap-align: center; /* Центрируем, чтобы не было жесткой привязки к левому краю */
}

/* Valid input glowing state (matches .input-toggle.is-active) */
.input.is-valid {
  border: 1px solid transparent !important;
  background:
    linear-gradient(176.35deg, rgba(244, 63, 94, 0.1), rgba(245, 158, 11, 0.1))
      padding-box,
    linear-gradient(var(--bg-1), var(--bg-1)) padding-box,
    linear-gradient(176.35deg, #f43f5e, #f59e0b) border-box !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
  background-origin: border-box;
}

/* Fix for light mode (shadow visibility) */
:root[data-theme="light"] .input.is-valid {
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
  background:
    linear-gradient(176.35deg, rgba(244, 63, 94, 0.2), rgba(245, 158, 11, 0.2))
      padding-box,
    linear-gradient(var(--bg-1), var(--bg-1)) padding-box,
    linear-gradient(176.35deg, #f43f5e, #f59e0b) border-box !important;
}

.reg-link {
  text-decoration: none;
  border-bottom: 1px solid;
  border-image: linear-gradient(
      176.35deg,
      rgba(244, 63, 94, 1),
      rgba(245, 158, 11, 1)
    )
    1;
  background-image: linear-gradient(
    176.35deg,
    rgba(244, 63, 94, 1),
    rgba(245, 158, 11, 1)
  ) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

/* =========================================
   DASHBOARD STYLES
   ========================================= */

/* Main Layout */
.workspace__content {
  margin-left: 260px;
  padding: 20px 24px;
  padding-top: 10px; /* Reduced top padding */
  min-height: 100vh;
  position: relative;
  background: transparent;
}
.dash-view {
  max-width: 1200px;
  margin: 0 auto;
}
.dash-header {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 300;
  color: var(--fg-strong);
  margin-bottom: 24px;
  margin-top: 0;
}

/* Grid Layout */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 24px;
}

/* CARDS Shared */
.dash-card {
  background: #11141d; /* Deep Dark */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
:root[data-theme="light"] .dash-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.tour-card .card__head {
  margin-bottom: 16px;
  height: 48px;
  gap: 0;
}
.tour-card .card__title {
  font-family: var(--font-head);
  font-size: 18px; /* Smaller, cleaner */
  font-weight: 800;
  color: white;
}

:root[data-theme="light"] .tour-card .card__title {
  color: black;
}

.tour-card .card__sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 0px;
}
.text-accent-icon {
  fill: url(#navGradient) !important;
  color: transparent;
}
.text-accent {
  color: #fff;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.text-green {
  color: #10b981 !important;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* 1. Active Tournament */
.tour-card {
  grid-column: span 2;
  background: linear-gradient(
    169.22deg,
    rgba(244, 63, 94, 0.2),
    rgba(245, 158, 11, 0.2) 100%
  );
}
:root[data-theme="light"] .tour-card {
  background: linear-gradient(
    169.22deg,
    rgba(244, 63, 94, 0.2),
    rgba(245, 158, 11, 0.2) 100%
  );
}
.tour-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px; /* More space before button */
  flex: 1;
}
.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: auto; /* Taller */
}
:root[data-theme="light"] .stat-box {
  background: rgba(0, 0, 0, 0.03);
}

.stat-box__label {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.stat-box__val {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 500;
  color: var(--fg-strong);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-box__sub {
  font-size: 12px;
  color: var(--fg-muted);
}

.btn--gradient-block {
  width: 100%;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.btn--gradient-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.5);
}

/* 2. Profile Card */
.profile-card {
  grid-column: span 1;
}
.profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.profile-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.metric {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px 12px;
}
:root[data-theme="light"] .metric {
  background: rgba(0, 0, 0, 0.03);
}

.metric__label {
  font-size: 11px;
  color: var(--fg-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.metric__val {
  font-size: 20px;
  color: var(--fg-strong);
  font-weight: 500;
  font-family: var(--font-head);
}
.profile-actions {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.btn--subtle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-muted);
  border: none;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  justify-content: center;
}
:root[data-theme="light"] .btn--subtle {
  background: rgba(0, 0, 0, 0.05);
}

/* 3. Daily Task */
.task-card {
  grid-column: span 1;
}

.task-card .card__head {
  height: 56px;
  gap: 4px;
}

.task-card .card__sub {
  color: rgba(136, 136, 153, 255);
}

.task-title-large {
  font-family: var(--font-head);
  font-size: 24px;
  color: var(--fg-strong);
  font-weight: 800;
  margin-top: 8px;
  line-height: 1.2;
}
.task-circle-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.dash-card .task-circle {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.1),
    rgba(245, 158, 11, 0.1)
  );
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  position: relative;
}
:root[data-theme="light"] .task-circle {
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.2),
    rgba(245, 158, 11, 0.2)
  );
  box-shadow: 0 10px 40px rgba(244, 63, 94, 0.15);
}
.task-circle::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.3),
    rgba(245, 158, 11, 0.1)
  );
  z-index: -1;
  opacity: 0.5;
}
:root[data-theme="light"] .task-circle::after {
  display: none;
}
.task-code-icon {
  font-size: 60px !important;
  font-weight: 300;
  line-height: 60px !important;
  transition: all 0.3s ease;
  fill: url(#navGradient) !important;
}

/* Hover effects for Task Card */
.task-card:hover .task-circle {
  transform: translateY(-8px);
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 1),
    rgba(245, 158, 11, 1)
  );
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.4);
}

.task-card:hover .task-code-icon {
  fill: #fff !important;
  transform: scale(1.1);
}

.task-card {
  transition: border-color 0.3s ease;
}

.task-card:hover {
  border-color: rgba(244, 63, 94, 0.3);
}

.task-circle {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.task-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chip-dark {
  background: #2a1018; /* Dark red bg */
  border: 1px solid #5a1020;
  color: #f43f5e;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
:root[data-theme="light"] .chip-dark {
  background: rgba(244, 63, 94, 0.1);
  border: none;
}

/* 4. Rating Chart */
/* 4. Rating Chart */
.chart-card {
  grid-column: span 1;
}
.chart-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 190px;
  margin-top: auto;
  padding: 40px 0 10px;
}
.chart-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  flex: 1;
  height: 100%;
  min-width: 0;
  position: relative;
  cursor: pointer;
}
.bar-val {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-head);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: translateY(10px);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  min-height: 18px;
  pointer-events: none; /* Чтобы не мешало ховеру на баре */
}

.bar-val span {
  grid-area: 1/1; /* Stack them */
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bar-val .val-secondary {
  opacity: 0;
  transform: translateY(10px);
}

.chart-col:hover .bar-val.has-toggle .val-primary {
  opacity: 0;
  transform: translateY(-10px);
}
.chart-col:hover .bar-val.has-toggle .val-secondary {
  opacity: 1;
  transform: translateY(0);
}

.bar-lbl {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 8px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bar {
  width: 100%;
  /* 20% opaque base */
  background: linear-gradient(
    180deg,
    rgba(244, 63, 94, 0.2) 0%,
    rgba(245, 158, 11, 0.05) 100%
  );
  border-radius: 8px;
  transition:
    height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

/* Active / Hover State */
.chart-col.is-active .bar-val,
.chart-col:hover .bar-val {
  opacity: 1;
  transform: translateY(0);
}

.chart-col.is-active .bar {
  /* 100% opaque for active */
  background: linear-gradient(
    180deg,
    rgba(244, 63, 94, 1) 0%,
    rgba(245, 158, 11, 1) 100%
  );
  box-shadow: 0 10px 25px rgba(244, 63, 94, 0.2);
}

.chart-col:not(.is-active):hover .bar {
  /* Slightly more on hover */
  background: linear-gradient(
    180deg,
    rgba(244, 63, 94, 0.4) 0%,
    rgba(245, 158, 11, 0.1) 100%
  );
}

/* Light theme overrides */
:root[data-theme="light"] .chart-col:not(.is-active) .bar {
  background: linear-gradient(
    180deg,
    rgba(244, 63, 94, 0.2),
    rgba(245, 158, 11, 0.05)
  );
}

/* 5. Pulse Chart */
.pulse-card {
  grid-column: span 1;
}
.metric-chart .bar {
  min-width: 6px;
  border-radius: 4px;
}
.pulse-foot {
  margin-top: 20px;
  font-size: 13px;
  color: var(--fg-muted);
}

.admin-home-view {
  display: grid;
  gap: 24px;
}

.admin-home-grid {
  align-items: stretch;
}

.admin-home-hero {
  grid-column: span 2;
  gap: 20px;
}

.admin-home-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-home-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-home-hero__actions {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.admin-home-hero__actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-home-summary-card,
.admin-home-attention-card,
.admin-home-feed-card,
.admin-home-chart-card {
  gap: 18px;
}

.admin-home-summary-grid {
  margin-bottom: 6px;
}

.admin-home-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: auto;
}

.admin-home-alert-list {
  display: grid;
  gap: 12px;
}

.admin-home-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.admin-home-alert--accent {
  border-color: color-mix(in oklab, var(--accent-to) 26%, var(--line));
}

.admin-home-alert--warning {
  border-color: color-mix(in oklab, #fbbf24 32%, var(--line));
}

.admin-home-alert--danger {
  border-color: color-mix(in oklab, #ef4444 34%, var(--line));
}

.admin-home-alert--muted {
  border-color: var(--line);
}

.admin-home-alert__icon .ops-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.admin-home-alert__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-home-alert__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.admin-home-alert__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.admin-home-feed-card--wide {
  grid-column: span 2;
}

.admin-home-feed,
.admin-home-users {
  display: grid;
  gap: 12px;
}

.admin-home-feed__item,
.admin-home-user {
  appearance: none;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  padding: 16px 18px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.admin-home-feed__item:hover,
.admin-home-user:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--accent-to) 28%, var(--line));
  background: rgba(255, 255, 255, 0.05);
}

.admin-home-feed__item {
  display: grid;
  gap: 10px;
}

.admin-home-feed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-home-feed__title,
.admin-home-user__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.admin-home-feed__meta,
.admin-home-user__meta {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.admin-home-feed__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-home-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1;
}

.admin-home-feed__empty {
  display: grid;
  gap: 8px;
  min-height: 220px;
  align-content: center;
  justify-items: start;
  padding: 12px 4px;
}

.admin-home-feed__empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.admin-home-feed__empty-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 44ch;
}

.admin-home-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-home-user__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-home-user__badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

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

.admin-home-chart-wrap {
  position: relative;
  min-height: 320px;
}

.admin-home-chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 320px !important;
}

/* MOBILE HEADER */
.workspace-mobile-header {
  display: none !important; /* Force hide on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  backdrop-filter: saturate(1.1) blur(8px);
  background: color-mix(in oklab, var(--bg-2) 75%, transparent);
  border-bottom: 1px solid var(--border);
  width: 100%; /* Ensure full width */
  height: var(--header-height);
}
.workspace-mobile-header .brand__text {
  display: block !important;
}

/* RESPONSIVE */

/* =========================================
   TOURNAMENTS VIEW STYLES
   ========================================= */

.tour-view {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.tour-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-input {
  width: 100%;
  background: color-mix(in oklab, var(--bg-1) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px 10px 40px;
  color: var(--fg-strong);
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: transparent;
  background: linear-gradient(
    176.35deg,
    rgba(244, 63, 94, 0.1),
    rgba(245, 158, 11, 0.1)
  );
}

.search-wrap::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 13px; /* Radius input + border */
  padding: 1px;
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-wrap:focus-within::before {
  opacity: 1;
}

.search-wrap:focus-within .search-input {
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  font-size: 20px;
}

/* Tabs */
.tour-filters-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1001; /* Выше чем карточки турниров */
}

.tabs-nav {
  display: flex;
  gap: 32px; /* Wider gap like in photo */
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 32px;
}

.tab-item {
  font-size: 15px;
  color: var(--fg-muted);
  cursor: pointer;
  position: relative;
  padding: 0 4px 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-item .icon {
  font-size: 20px;
  color: inherit;
  transition: inherit;
}

.tab-item:hover {
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent; /* Main text is white,*/
}

.tab-item.active {
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tab-item.active .icon,
.tab-item.active .icon-svg,
.tab-item:hover .icon,
.tab-item:hover .icon-svg {
  fill: url(#navGradient) !important;
}

.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
  border-radius: 4px 4px 0 0;
}

/* Chips Row */
.chips-row {
  display: grid;
  grid-template-columns: 1fr auto; /* Chips take rest, icons stay right */
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.chips-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap; /* Allow wrapping again as requested */
  flex: 1;
  min-width: 0;
}

.chip-btn {
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chip-btn.active {
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.chip-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.15);
}

.action-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0; /* Never shrink icons */
}

.btn--icon-only {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--fg-muted);
}

.btn--icon-only:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-strong);
}

/* Tournament Card List */
.tour-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1; /* Базовый слой для карточек */
}

.tour-more-action {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.btn--more {
  width: 100%;
  max-width: 320px;
  justify-content: center;
  border-radius: 16px !important;
  font-weight: 500;
  font-size: 15px !important;
  padding: 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.btn--more:active {
  transform: translateY(0) scale(0.97) !important;
  filter: brightness(0.9);
}

.tournament-card {
  background: #11141d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.tournament-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 63, 94, 0.2);
}

.tournament-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  opacity: 0.8;
}

.tour-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Состояния */
.status--live {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}
.status--live .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  animation: pulse-dot 2s infinite;
}

.status--upcoming {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}
.status--upcoming .status-dot {
  background: #f59e0b;
}

.status--ended {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
}
.status--ended .status-dot {
  background: #f43f5e;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Светлая тема */
:root[data-theme="light"] .status-tag {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .status--live {
  background: #dcfce7;
  color: #15803d;
}
:root[data-theme="light"] .status--upcoming {
  background: #fef3c7;
  color: #b45309;
}
:root[data-theme="light"] .status--ended {
  background: #fee2e2;
  color: #b91c1c;
}

.participants-count {
  font-size: 12px;
  color: var(--fg-muted);
}

.tour-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tour-card__title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 400;
  color: var(--fg-strong);
}

.tour-card__desc {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.tour-card__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 4px 0;
}

.tour-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-muted);
  font-size: 13px;
}

.tour-meta-item .icon-svg {
  font-size: 18px;
}

.btn--join {
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  color: white;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn--join:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

.btn--outline-tour {
  background: transparent;
  border: 2px solid #f59e0b;
  color: #f59e0b;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn--outline-tour:active {
  transform: scale(0.96);
  background: #d97706;
}

.btn--outline-tour .icon-svg {
  font-size: 22px;
}

.btn--muted-tour {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--fg);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn--muted-tour:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.98);
}

/* Light Theme Overrides */
:root[data-theme="light"] .search-input {
  background: #ffffff;
  border-color: #e5e7eb;
}

:root[data-theme="light"] .search-wrap:focus-within .search-input {
  background: linear-gradient(
    176.35deg,
    rgba(244, 63, 94, 0.2),
    rgba(245, 158, 11, 0.2)
  );
}

:root[data-theme="light"] .tabs-nav {
  border-color: #e5e7eb;
}
:root[data-theme="light"] .chip-btn {
  background: #f5f5f7;
  border-color: #e5e7eb;
  color: #4b5563;
}
:root[data-theme="light"] .chip-btn.active {
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  color: #ffffff;
  border-color: transparent;
}
:root[data-theme="light"] .btn--icon-only {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #4b5563;
}
:root[data-theme="light"] .btn--icon-only:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
:root[data-theme="light"] .tournament-card {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}
:root[data-theme="light"] .tour-card__divider {
  background: #e5e7eb;
}
:root[data-theme="light"] .btn--muted-tour {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--fg);
}

/* Popover System */
.tour-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: #1a1e29;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: none;
  animation: fadeInScale 0.2s ease-out;
  min-width: 272px;
}

.tour-popover.visible {
  display: block;
}

.tour-popover--left {
  right: auto;
  left: 0;
}

.popover-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-strong);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popover-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative; /* Для позиционирования подсказки */

  /* Запрещаем выделение текста и вызов системного меню на мобилках */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Подсказка при зажатии (Tooltip) */
.popover-item::after {
  content: attr(data-full);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1e2533;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.popover-item:active::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

:root[data-theme="light"] .popover-item::after {
  background: #ffffff;
  color: #11141d;
  border-color: #e5e7eb;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.popover-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-item:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.98);
}

.popover-item.active {
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  color: white !important;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

/* Internal search in popovers */
.popover-search-wrap {
  margin-bottom: 12px;
}

.popover-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--fg-strong);
  outline: none;
}

.popover-search:focus {
  border-color: #f43f5e;
}

.popover-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
}

.btn-reset-link {
  background: none;
  border: none;
  color: #f43f5e;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  transition: opacity 0.2s;
}

.btn-reset-link:hover {
  opacity: 0.8;
}

.popover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden; /* Убираем боковой скролл */
  padding-right: 8px;
}

.popover-grid::-webkit-scrollbar {
  width: 4px;
}
.popover-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Calendar Styling */
.calendar-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  background: #1a1e29;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 280px;
}

.calendar-popover.visible {
  display: block;
  animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-label {
  font-size: 11px;
  color: var(--fg-muted);
  text-align: center;
  padding-bottom: 8px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-day:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.1);
}
.cal-day.active {
  background: linear-gradient(90deg, #f43f5e, #f59e0b) !important;
  color: white !important;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3);
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-strong);
}

.cal-nav {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: all 0.2s;
}

.cal-nav:active {
  transform: scale(0.9);
}

.cal-nav .icon-svg {
  font-size: 20px;
}

.cal-day.empty {
  cursor: default;
  pointer-events: none;
}

.cal-day.today {
  border: 1px solid #f43f5e;
  color: #f43f5e;
}

:root[data-theme="light"] .calendar-popover {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .tour-popover {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .popover-item:hover {
  background: #f5f5f7;
}
:root[data-theme="light"] .popover-title {
  border-bottom-color: #e5e7eb;
}

.card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__foot .icon-text {
  display: flex;
  align-items: center;
  gap: 4px;
}
.card__foot .icon-text .span:last-child {
  color: rgba(255, 255, 255, 255);
  font-family: var(--font-body);
  font-style: normal;
  font-size: 18px;
  font-weight: 300;
  line-height: 28px;
  letter-spacing: 0px;
}
.card__foot .icon-text .fire {
  fill: url(#navGradient) !important;
  background: none !important;
  color: transparent !important;
  -webkit-text-fill-color: initial !important;
  background-clip: border-box !important;
  font-style: normal;
  font-size: 24px !important;
  font-weight: 300;
  line-height: 28px;
  letter-spacing: 0px;
  display: inline-block;
  vertical-align: middle;
}

/* =========================================
   ANIMATIONS & TOOLTIPS
   ========================================= */

/* Custom Tooltip disabled (using bar-val instead) */
.chart-col {
  position: relative;
  cursor: pointer;
}
.chart-col:hover .bar {
  filter: brightness(1.2);
}

/* Animations */
@keyframes growBar {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chart-col .bar {
  animation: growBar 1s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
/* Stagger animations for bars */
.chart-col:nth-child(1) .bar {
  animation-delay: 0.1s;
}
.chart-col:nth-child(2) .bar {
  animation-delay: 0.15s;
}
.chart-col:nth-child(3) .bar {
  animation-delay: 0.2s;
}
.chart-col:nth-child(4) .bar {
  animation-delay: 0.25s;
}
.chart-col:nth-child(5) .bar {
  animation-delay: 0.3s;
}
.chart-col:nth-child(6) .bar {
  animation-delay: 0.35s;
}
.chart-col:nth-child(7) .bar {
  animation-delay: 0.4s;
}
.chart-col:nth-child(8) .bar {
  animation-delay: 0.45s;
}

/* Pulse Breath Animation */
@keyframes pulseBreath {
  0%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(0.95);
  }
}
.metric-chart .chart-col.is-active .bar {
  animation:
    growBar 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards,
    pulseBreath 3s infinite ease-in-out 1s; /* Start breathing after grow */
}

/* Dashboard Entry Animations */
[data-view-anim] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
[data-view-anim].in {
  opacity: 1;
  transform: translateY(0);
}

#workspace-view[hidden] .workspace-mobile-header {
  display: none !important;
}

#tournaments .card__head {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* =========================================
   LOADER & 404 PAGE
   ========================================= */

/* Global Loader Overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: #0b0d11;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.loader-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

#app {
  transition: opacity 0.4s ease;
}

.loader-overlay[hidden] {
  display: none; /* Fallback for legacy app logic */
}

/* Rolling Cube Animation */
.cube-wrapper {
  width: 60px;
  height: 60px;
  position: relative;
  perspective: 200px;
}

.cube {
  width: 40px;
  height: 40px;
  position: absolute;
  bottom: 0;
  left: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  background-size: 200% 200%;
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.4);
  animation:
    cubeRoll 1.2s infinite ease-in-out,
    cubeShimmer 2s infinite linear;
}

@keyframes cubeRoll {
  0% {
    transform: rotate(0deg);
    left: 0;
  }
  25% {
    transform: rotate(90deg);
    left: 20px;
  }
  50% {
    transform: rotate(180deg);
    left: 40px;
  }
  75% {
    transform: rotate(270deg);
    left: 20px;
  }
  100% {
    transform: rotate(360deg);
    left: 0;
  }
}

@keyframes cubeShimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.loader-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-strong);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  animation: pulseText 1.5s infinite ease-in-out;
}

@keyframes pulseText {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

body.loading {
  overflow: hidden;
}

/* 404 Page Styles */
.error-page {
  background: var(--bg);
  color: var(--fg);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.error-content {
  max-width: 500px;
  padding: 24px;
  z-index: 10;
}

.error-cube-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 40px;
  display: grid;
  place-items: center;
}

.error-cube {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 20px 50px rgba(244, 63, 94, 0.3);
  position: relative;
  animation: glitchCube 3s infinite;
}

@keyframes glitchCube {
  0%,
  100% {
    transform: rotate(0) scale(1);
  }
  30% {
    transform: rotate(5deg) scale(1.05);
    filter: hue-rotate(15deg);
  }
  35% {
    transform: rotate(-3deg) scale(0.98);
  }
  70% {
    transform: rotate(-5deg) scale(1.02);
    filter: hue-rotate(-10deg);
  }
}

.error-title {
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(to right, #fff, var(--fg-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-subtitle {
  font-size: 16px;
  color: var(--fg-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.decor-cube {
  position: absolute;
  background: var(--muted);
  border-radius: 8px;
  opacity: 0.05;
  z-index: 1;
}

.decor-1 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 10%;
  transform: rotate(15deg);
}
.decor-2 {
  width: 150px;
  height: 150px;
  bottom: 15%;
  right: 10%;
  transform: rotate(-10deg);
}
.decor-3 {
  width: 60px;
  height: 60px;
  top: 60%;
  left: 15%;
  transform: rotate(45deg);
}

/* =========================================
   TOAST NOTIFICATION SYSTEM
   ========================================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent-from);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transform: translateX(120%);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease;
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-from);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.toast__content {
  flex-grow: 1;
}

.toast__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-strong);
  margin-bottom: 2px;
}

.toast__desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.4;
}

/* Toast States */
.toast--success {
  border-left-color: #10b981;
}
.toast--success .toast__icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.toast--error {
  border-left-color: #f43f5e;
}
.toast--error .toast__icon {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
}

.toast--info {
  border-left-color: #3b82f6;
}
.toast--info .toast__icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 var(--radius);
  background: currentColor;
  opacity: 0.3;
  animation: toast-progress linear forwards;
}

.toast--success .toast__progress { color: #10b981; }
.toast--error .toast__progress { color: #f43f5e; }
.toast--info .toast__progress { color: #3b82f6; }

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Focus-visible states */
.btn:focus-visible,
.tab-item:focus-visible,
.ops-list-card:focus-visible,
.ops-choice-card:focus-visible,
.ops-entity-row:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--accent-from);
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible),
.tab-item:focus:not(:focus-visible),
.ops-list-card:focus:not(:focus-visible) {
  outline: none;
}

/* Skeleton loading shimmer */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--muted) 25%,
    var(--muted-2) 50%,
    var(--muted) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton--text {
  height: 1em;
  border-radius: 6px;
}

.skeleton--card {
  min-height: 120px;
}

.skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.input-toggle.is-active {
  border-color: transparent;
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  color: transparent;
}

/* ========================================= */
/*      CONSOLIDATED MEDIA QUERIES         */
/* ========================================= */

@media (prefers-contrast: more) {
  .grid {
    opacity: calc(var(--grid-o) + 0.05);
  }
}
@media (hover: hover) {
  .nav__link:hover {
    color: var(--fg-strong);
  }

  .btn--muted:hover {
    background: var(--muted-2);
  }

  .btn--accent:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.5);
  }
  .btn--accent:active {
    transform: translateY(0);
  }

  .drawer__link:hover {
    background: var(--muted-2);
  }

  .side-nav__dot:hover {
    transform: scale(1.1);
  }

  .card--all:hover {
    filter: brightness(1.05);
    color: #fff;
  }

  .card--all:hover {
    transform: translateY(-2px);
    filter: brightness(1.05); /* Added back for consistency */
  }
  .card--all:hover .arrow {
    transform: translate(2px, -50%);
  }

  .btn:hover,
  .topbar-btn:hover,
  .drawer__link:hover,
  .drawer__close:hover,
  .modal__close:hover,
  #burger:hover,
  #drawerClose:hover,
  #modalClose:hover {
    transform: translateY(calc(-1 * var(--btn-float)));
    color: #fff !important;
    background-image: linear-gradient(
      90deg,
      var(--accent-from),
      var(--accent-to)
    ) !important;
  }
  .btn--accent:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    filter: saturate(1.05);
  }
  .btn--muted:hover,
  .drawer__link:hover,
  .topbar-btn:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
    filter: brightness(1.03);
  }
  .btn--icon-only:hover,
  .drawer__close:hover,
  .modal__close:hover,
  #burger:hover {
    transform: translateY(calc(-0.6 * var(--btn-float))) scale(1.02);
  }
  .modal__close:hover {
    background: linear-gradient(176.35deg, #f43f5e, #f59e0b) !important;
  }
  .btn--hero:hover {
    transform: translateY(-2px);
    filter: saturate(1.05);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  }

  .drawer__item:hover {
    transform: translateY(-2px);
    background: var(--muted-2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
  }
  .drawer__item:hover .chev {
    transform: translateX(2px);
  }

  .nav-item:hover:not(.active) {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
    border-color: transparent;
  }
  .nav-item:hover:not(.active) .icon-svg {
    color: #fff;
    font-variation-settings:
      "FILL" 1,
      "wght" 300,
      "GRAD" 0,
      "opsz" 24;
  }

  .theme-toggle-ws:hover {
    color: var(--fg);
    background: var(--muted-2);
    transform: translateY(-1px);
  }

  .btn-nav:hover {
    background-image: linear-gradient(
      135deg,
      var(--accent-from),
      var(--accent-to)
    );
    color: #fff;
  }

  /* 1. HOVER (Любое состояние) - Яркий фон, белая иконка */
  .input-toggle:hover,
  .input-toggle.is-active:hover,
  .input-toggle:focus:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
    color: white;
    border-color: transparent;
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to)) !important;
  }
  .input-toggle:hover::before,
  .input-toggle.is-active:hover::before,
  .input-toggle:focus:hover::before {
    opacity: 0;
  }
  .input-toggle:hover::after,
  .input-toggle.is-active:hover::after,
  .input-toggle:focus:hover::after {
    opacity: 0;
  }
  .input-toggle:hover .input-toggle__icon-svg,
  .input-toggle.is-active:hover .input-toggle__icon-svg,
  .input-toggle:focus:hover .input-toggle__icon-svg {
    transform: scale(1.02);
  }
  .input-toggle:hover .input-toggle__icon-svg,
  .input-toggle.is-active:hover .input-toggle__icon-svg,
  .input-toggle:focus:hover .input-toggle__icon-svg,
  .input-toggle:hover .input-toggle__icon-svg path,
  .input-toggle.is-active:hover .input-toggle__icon-svg path,
  .input-toggle.is-active:focus:hover .input-toggle__icon-svg path {
    fill: currentColor !important;
  }
  .input-toggle.is-active:hover .input-toggle__icon-svg,
  .input-toggle.is-active:focus:hover .input-toggle__icon-svg {
    fill: #fff !important;
    color: #fff !important;
  }
  .input-toggle.is-active:hover .input-toggle__icon-svg path,
  .input-toggle.is-active:focus:hover .input-toggle__icon-svg path {
    fill: #fff !important;
    color: #fff !important;
  }

  .tab-item:hover:not(.active) {
    color: var(--fg-strong);
    opacity: 0.8;
  }

  .chip-btn:hover:not(.active) {
    background: linear-gradient(90deg, #f43f5e, #f59e0b);
    color: white;
  }

  .btn--more:hover {
    background: linear-gradient(90deg, #f43f5e, #f59e0b) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.2) !important;
    transform: translateY(-2px);
  }

  .btn--join:hover {
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
    transform: scale(1.02);
  }

  .btn--outline-tour:hover {
    background: #f59e0b;
    color: #11141d;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
  }

  .btn--muted-tour:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .popover-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg-strong);
  }

  .cal-day:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .cal-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg-strong);
  }
}
@media (min-width: 992px) {
  .nav {
    display: flex;
  }
}
@media (min-width: 1400px) {
  .side-nav {
    display: flex;
    right: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .word {
    animation: none;
  }

  .btn,
  .topbar-btn,
  .drawer__link,
  .drawer__close,
  .modal__close,
  #burger,
  #drawerClose,
  #modalClose {
    transition-duration: 0.05s;
  }
  .btn:hover,
  .topbar-btn:hover,
  .drawer__link:hover,
  .drawer__close:hover,
  .modal__close:hover,
  #burger:hover,
  #drawerClose:hover,
  #modalClose:hover {
    transform: translateY(-1px);
  }

  .drawer__panel,
  .drawer__backdrop {
    transition: none !important;
  }
}
@media (min-width: 640px) {
  .hscroll {
    grid-auto-columns: 50%;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1200px) {
  .hscroll {
    grid-auto-columns: 33.333%;
  }
}
@media (max-width: 640px) {
  .hero__inner {
    gap: 12px;
    padding-inline: 20px;
  }
  .formulas span {
    font-size: 14px !important;
  }
}
@media (max-width: 400px) {
  h2.section__title.in {
    width: 200px;
  }

  #codeModal .modal__panel {
    width: 96vw;
    padding: 12px;
  }
  .code-grid {
    grid-template-columns: repeat(4, 32px) 12px repeat(4, 32px);
    gap: 6px;
  }
  .code-cell {
    width: 32px;
    height: 38px;
    line-height: 38px;
    font-size: 18px;
  }
}
@media (max-width: 480px) {
  .row--cta .chip {
    width: 100%;
    justify-content: center;
  }

  .code-grid {
    grid-template-columns: repeat(4, 38px) 22px repeat(4, 38px);
    gap: 6px;
  }
  .code-cell {
    width: 38px;
    height: 46px;
    line-height: 46px;
  }

  .toast-container {
    top: auto;
    bottom: 100px; /* Над мобильной навигацией */
    left: 16px;
    right: 16px;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 1088px) {
  .tour-popover {
    position: absolute !important;
    top: calc(100% + 12px) !important;
    bottom: auto !important;
    left: auto !important; /* Will be set by modifier */
    right: auto !important; /* Will be set by modifier */
    max-width: calc(100vw - 32px) !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 1000;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 12px !important;
  }

  .tour-popover * {
    box-sizing: border-box !important;
  }

  .tour-popover--right {
    right: 0 !important;
    left: auto !important;
  }
  .tour-popover--left {
    left: 0 !important;
    right: auto !important;
  }
  /* .sidebar {
        width: 80px;
    } */
  .sidebar__brand .brand__text,
  .sidebar__nav span:last-child {
    display: none;
  }
  .workspace__content {
    width: calc(100% - 80px);
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-cell--large {
    grid-column: auto;
  }

  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tour-card {
    grid-column: span 2;
  }
  .profile-card {
    grid-column: span 1;
  }
  .task-card {
    grid-column: span 1;
  }
  .chart-card {
    grid-column: span 1;
  }
  .pulse-card {
    grid-column: span 1;
  }

  .admin-home-hero,
  .admin-home-feed-card--wide {
    grid-column: span 2;
  }

  .workspace__content {
    padding: 24px;
  }
}
@media (max-width: 420px) {
  .code-grid {
    grid-template-columns: repeat(4, 36px) 18px repeat(4, 36px);
    gap: 6px;
  }
  .code-cell {
    width: 36px;
    height: 44px;
    line-height: 44px;
  }
}
@media (max-width: 350px) {
  #codeModal .modal__panel {
    width: 96vw;
    padding: 10px;
  }
  .code-grid {
    grid-template-columns: repeat(4, 30px) 10px repeat(4, 30px);
    gap: 5px;
  }
  .code-cell {
    width: 30px;
    height: 36px;
    line-height: 36px;
    font-size: 17px;
  }

  /* Адаптация сетки кода под узкие экраны */
  .code-grid {
    gap: 3px !important;
    grid-template-columns: repeat(4, 1fr) 8px repeat(4, 1fr) !important;
  }
  .code-cell {
    width: auto !important; /* тянемся */
    min-width: 24px;
    height: 36px;
    font-size: 16px;
    padding: 0;
  }
  #codeModal .modal__panel,
  #verifyModal .modal__panel {
    padding: 12px 10px;
  }
  .modal__panel {
    width: 95vw !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
  }
  .modal {
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  }
  /* Кнопки тоже чуть компактнее */
  .btn {
    padding: 10px 10px;
    font-size: 14px;
  }
  .brand__text {
    display: none; /* Скрываем текст бренда если совсем узко, оставляем лого */
  }
  .header__actions {
    gap: 8px;
  }
  .section__title {
    font-size: 20px;
  }

  .tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 20px;
    padding-left: 2px;
  }
  .tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .tab-item {
    flex-shrink: 0;
  }

  /* Small screens adjustment for filters */
  .chips-row {
    gap: 8px !important;
  }
  .action-btns {
    gap: 4px !important;
  }
  .chip-btn {
    padding: 5px 12px !important;
    font-size: 12px !important;
  }
  .btn--icon-only {
    padding: 0 !important;
    justify-content: center;
  }

  .chips-list {
    padding-bottom: 4px;
  }
  .chips-list::-webkit-scrollbar {
    display: none;
  }
  .chip-btn {
    flex-shrink: 0;
  }
}
@media (max-width: 768px) {
  .team-invite-card {
    border-radius: 24px;
    padding: 24px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .invite-icon-box {
    margin: 0 auto;
  }
  .invite-actions {
    width: 100%;
    justify-content: center;
    gap: 12px;
  }
  .invite-actions .btn {
    flex: 1;
    padding: 12px 16px !important;
  }

  .sidebar__brand .brand__text,
  .sidebar__nav span:last-child {
    display: inline-block;
  }
  .sidebar__nav .nav-item {
    justify-content: start;
    padding: 0;
  }
  .nav-item {
    padding: 10px 16px !important;
  }
  .sidebar__nav {
    padding: 0 24px;
  }
  .sidebar__brand {
    flex-direction: row;
  }
  .sidebar__brand .brand {
    margin-bottom: 0;
  }

  .workspace-mobile-header {
    display: flex !important; /* Show on mobile */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
  }
  #workspace-view {
    display: block !important;
    padding-top: var(--header-height) !important;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  #workspace-view[hidden] {
    display: none !important;
  }

  .workspace__content {
    margin-left: 0 !important; /* FORCE RESET MARGIN */
    padding-top: 72px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: 100%;
  }
  .dash-view {
    padding: 0;
    max-width: 100%;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    background: var(--bg-1);
    width: 280px;
    position: fixed; /* Ensure fixed */
    top: 0;
    left: 0;
    bottom: 0;
  }
  .sidebar.visible {
    transform: translateX(0);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
  }
  .workspace__content:has(.sidebar.visible) {
    /* затемнение */
    filter: blur(2px);
  }
  .dash-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .dash-header {
    font-size: 28px;
    margin-bottom: 16px;
  }
  .stat-box {
    padding: 12px;
    height: auto;
    min-height: 100px;
  }

  .tour-head-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-wrap {
    max-width: 100%;
  }
  .tour-card__title {
    font-size: 18px;
  }
  .tour-card__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .btn--join,
  .btn--outline-tour,
  .btn--muted-tour {
    justify-content: center;
  }

  /* Fix popovers on mobile - Restore relative positioning */
  .tour-popover,
  .calendar-popover {
    position: absolute !important;
    top: calc(100% + 12px) !important;
    left: auto !important;
    right: auto !important;
    max-width: calc(100vw - 32px) !important;
    transform: none !important;
    z-index: 2000;
    margin: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }

  .tour-popover--right,
  .calendar-popover--right {
    right: 0 !important;
    left: auto !important;
  }
  .tour-popover--left,
  .calendar-popover--left {
    left: 0 !important;
    right: auto !important;
  }

  .calendar-popover {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    position: static !important;
  }

  .cal-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 0px !important;
    margin-top: 4px !important;
    width: 100% !important;
  }

  .cal-day {
    font-size: 11px !important;
    height: 28px !important;
    width: 100% !important;
    aspect-ratio: auto !important;
    border-radius: 6px;
  }

  .cal-day-label {
    font-size: 10px !important;
    padding-bottom: 2px !important;
    font-weight: 500 !important;
    opacity: 0.6;
  }

  .popover-title {
    font-size: 13px !important;
    padding-bottom: 6px !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
  }

  .popover-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .popover-footer {
    margin-top: 6px !important;
    padding-top: 6px !important;
  }

  /* Календарный подзаголовок (Январь 2026) */
  .cal-header {
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .cal-title {
    font-size: 13px !important;
    font-weight: 600 !important;
  }

  .cal-nav {
    background: none !important;
    border: none !important;
    color: var(--fg-muted) !important;
    cursor: pointer !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
  }

  .cal-nav .icon-svg {
    font-size: 18px !important;
  }

  .calendar-popover > div:first-child {
    margin-bottom: 0px !important;
  }
}
@media (max-width: 600px) {
  #workspace-content
    > div.dash-view
    > div
    > div.card.dash-card.tour-card.in
    > div.tour-stats {
    grid-template-columns: 1fr;
  }
}

/* TEAM VIEW */
.team-view {
  padding-bottom: 40px;
  padding-top: 0;
  max-width: 1200px;
  margin: 0 auto;
}

.team-tabs {
  display: flex;
  gap: 32px;
  margin-top: 8px;
  border-bottom: 1px solid var(--border);
}

/* Icons in tabs specific handling if needed */
.tab-item .icon {
  -webkit-background-clip: text;
  background-clip: text;
  font-family: Material Symbols Outlined;
  font-style: Regular;
  font-size: 20px;
  font-weight: 300;
  line-height: 28px;
  letter-spacing: 0px;
  text-align: left;
}

.tab-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.team-separator {
  height: 1px;
  background: var(--border); /* Match tabs border */
  margin-bottom: 12px;
  width: 100%;
}

/* GRADIENT BORDER UTILITY FOR CARDS */
.card-gradient-border {
  position: relative;
  background: var(--bg-1); /* Inner bg */
  background-clip: padding-box;
  border: 1px solid transparent;
  border-radius: 999px;
}
.card-gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
}

/* Invite Card */
.team-invite-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px;
  margin: 32px 0 12px 0;
  width: 100%;
  position: relative;
  border-radius: 24px;
  background: linear-gradient(
    90deg,
    rgba(244, 63, 94, 0.1) 0%,
    rgba(245, 158, 11, 0.1) 100%
  );
  border: none;
}

.team-invite-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

:root[data-theme="light"] .team-invite-card {
  background: linear-gradient(
    90deg,
    rgba(244, 63, 94, 0.2) 0%,
    rgba(245, 158, 11, 0.2) 100%
  );
}

.invite-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #000;
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.4);
}

.invite-icon-box .icon-svg {
  font-size: 26px;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.invite-content {
  flex: 1;
  min-width: 0;
}

.invite-title {
  color: var(--fg-strong);
  font-size: 16px;
  font-weight: 300;
  line-height: 24px;
  letter-spacing: 0px;
}

.invite-desc {
  font-size: 14px;
  font-weight: 300;
  line-height: 20px;
  letter-spacing: 0px;
  text-align: left;
  color: var(--fg-muted);
}

.invite-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .team-invite-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin: 24px 0 12px 0;
  }

  .invite-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .invite-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .invite-actions .action-reject,
  .invite-actions .app-reject {
    order: 2;
    flex: 1;
  }
  .invite-actions .action-accept,
  .invite-actions .app-accept {
    order: 1;
    flex: 1;
  }
  .invite-actions .action-report,
  .invite-actions .app-report {
    order: 3;
    flex: 0;
    width: auto;
  }
}

/* .team-invite-card .btn {
    padding: 12px 36px !important;
    font-weight: 400;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
} */

/* .team-invite-card .btn--muted {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: none !important;
} */

.team-section-title {
  font-size: 24px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 16px;
}

.team-section-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 32px;
}

/* Team Management Grid */
.team-section-head {
  margin-bottom: 24px;
}

.team-section-title {
  font-size: 24px;
  font-weight: 300; /* As per design, thin header */
  color: var(--fg-strong);
  margin: 0 0 8px 0;
}

.team-section-desc {
  color: var(--fg-muted);
  font-size: 15px;
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

.team-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.team-action-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  align-items: flex-start;
  text-align: left; /* Let grid show? Or card bg */
  border: 1px solid var(--border);
  border-radius: 24px;
}

.action-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.action-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-strong);
  margin: 0 0 8px 0;
}

.action-desc {
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0 0 32px 0;
  line-height: 1.6;
  flex: 1;
}

.action-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(244, 63, 94, 0.2);
}

.action-icon-box span,
.action-icon-box .icon-svg {
  font-size: 24px;
  color: #000 !important;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* Override generic utility classes for these specific boxes */
.action-icon-box.bg-accent-soft,
.action-icon-box.bg-orange-soft {
  border: none !important;
}

.btn--wide {
  width: 100%;
  justify-content: center;
  max-width: 160px;
  height: 44px;
  font-weight: 600;
}

.text-accent-link {
  background: linear-gradient(176.35deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block; /* Чтобы работал transform */
  transition: all 0.3s ease; /* Добавим плавности */
}
.text-accent-link:hover {
  -webkit-text-fill-color: var(
    --fg-strong
  ); /* Сбрасываем прозрачность заливки */
  color: var(--fg-strong);
  transform: translateY(calc(-1 * var(--btn-float)));
}

/* SIDEBAR COLLAPSE SYSTEM */
@media (min-width: 769px) {
  .sidebar {
    transition: width 0.4s cubic-bezier(0.2, 0, 0, 1);
    overflow-x: hidden;
    overflow-y: auto;
    will-change: width;
  }

  /* Анимация контента внутри сайдбара */
  .sidebar .brand__text,
  .sidebar .nav-item span:not(.icon-svg) {
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      max-width 0.4s cubic-bezier(0.2, 0, 0, 1);

    opacity: 1;
    transform: translateX(0);
    white-space: nowrap; /* Чтобы текст не прыгал на новую строку */
    display: inline-block;
    max-width: 200px; /* Достаточно для текста */
    overflow: hidden;
  }

  .sidebar--collapsed {
    width: 80px !important;
  }

  /* Плавное скрытие текста при сворачивании */
  .sidebar--collapsed .brand__text,
  .sidebar--collapsed .nav-item span:not(.icon-svg) {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    max-width: 0;
    /* Ускоряем исчезновение, чтобы текст пропал до сужения панели */
    transition:
      opacity 0.15s ease,
      transform 0.15s ease,
      max-width 0.3s cubic-bezier(0.2, 0, 0, 1);
  }

  .sidebar--collapsed .sidebar__brand {
    flex-direction: column;
    gap: 12px;
    padding: 24px 0;
    align-items: center;
  }

  /* Важный момент: чтобы логотип не дергался при смене flex-direction */
  .sidebar .sidebar__brand {
    transition:
      gap 0.3s ease,
      padding 0.3s ease;
  }

  /* Расположение элементов меню */
  .sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    transition:
      padding 0.3s ease,
      justify-content 0.3s ease;
  }

  .sidebar--collapsed .nav-item {
    justify-content: center;
    padding: 12px 0; /* Уменьшаем паддинги */
  }

  .sidebar--collapsed .nav-item .icon-svg {
    margin: 0; /* Убираем возможные отступы у иконки */
  }

  .sidebar--collapsed .sidebar__nav {
    padding: 0 12px;
  }

  .sidebar--collapsed .sidebar__collapse-btn {
    transform: rotate(180deg);
    margin-left: 0; /* Центрируем кнопку */
  }

  .sidebar__collapse-btn {
    transition:
      transform 0.4s cubic-bezier(0.2, 0, 0, 1),
      margin 0.3s ease;
  }

  /* Adjust main content when sidebar is collapsed */
  .workspace__content {
    transition:
      margin-left 0.4s cubic-bezier(0.2, 0, 0, 1),
      width 0.4s cubic-bezier(0.2, 0, 0, 1);
    will-change: margin-left, width;
  }

  .sidebar--collapsed + .workspace-mobile-header + .workspace__content,
  body:has(.sidebar--collapsed) .workspace__content {
    margin-left: 80px !important;
    width: calc(100% - 80px) !important;
  }
}

.sidebar__collapse-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 44px;
  height: 44px;
}

.sidebar__collapse-btn:hover {
  opacity: 1;
  background: var(--muted-2);
}

@media (max-width: 768px) {
  .sidebar__collapse-btn {
    display: none; /* Hide on mobile */
  }
}

#workspace-view > aside.sidebar--collapsed > nav > a.nav-item {
  gap: 0;
}

#workspace-view > aside > div > div {
  margin-right: 5px;
}

#workspace-view > aside.sidebar--collapsed > div > div {
  gap: 0;
  margin-bottom: 12px;
  margin-right: 0;
}

#workspace-view > aside.sidebar--collapsed > nav > a {
  width: 52px;
}

#workspace-content
  > div.dash-view
  > div
  > div.card.dash-card.profile-card.in
  > div.card__head {
  margin-bottom: 22px;
}

#workspace-content
  > div.dash-view
  > div
  > div.card.dash-card.profile-card.in
  > div.profile-summary {
  margin-bottom: 22px;
}

/* Sidebar Footer & Profile Section */
.sidebar__workspace-links {
  margin: auto 24px 0;
  padding: 0 0 14px;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  opacity: 0.66;
  transition: opacity 0.18s ease;
}

.sidebar__workspace-links:hover {
  opacity: 1;
}

.sidebar__workspace-links a {
  color: color-mix(in oklab, var(--fg-muted) 78%, transparent);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.sidebar__workspace-links a:hover {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--fg-muted) 45%, transparent);
  text-underline-offset: 3px;
}

.sidebar__footer {
  margin-top: 0;
  padding: 14px 24px calc(33px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-1);
  transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  position: relative;
  padding: 1px;
  flex-shrink: 0;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-letter {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-strong);
}

.profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    max-width 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.profile-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-uid {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg-muted);
  opacity: 0.7;
  white-space: nowrap;
}

.btn-notif {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
}
.btn-notif.has-unread::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  box-shadow: 0 0 0 2px var(--bg-1);
}

/* .btn-notif:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg-strong);
    border-color: var(--border-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-notif:active {
    transform: translateY(0);
} */

.btn-notif .icon-svg {
  font-size: 22px;
}

/* Collapsed state adjustments for Footer */
.sidebar--collapsed .sidebar__workspace-links {
  display: none;
}

.sidebar--collapsed .sidebar__footer {
  margin-top: auto;
  flex-direction: column-reverse;
  padding: 24px 0 calc(33px + env(safe-area-inset-bottom, 0px));
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.sidebar--collapsed .profile-meta {
  opacity: 0;
  max-width: 0;
  transform: translateX(-10px);
  pointer-events: none;
  margin: 0;
}

.sidebar--collapsed .sidebar__profile {
  gap: 0;
  justify-content: center;
}

.sidebar--collapsed .btn-notif {
  margin: 0 auto;
}

.modal__panel--notifications {
  width: min(860px, calc(100vw - 40px));
  max-width: min(860px, calc(100vw - 40px));
  max-height: min(82vh, 860px);
  padding: var(--space-lg);
  overflow: hidden;
}
.notifications-body {
  padding: var(--space-md) 0;
  overflow: auto;
  max-height: calc(min(82vh, 860px) - 84px);
}

.notifications-shell {
  display: grid;
  gap: 18px;
}

.notifications-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.notifications-toolbar__copy {
  display: grid;
  gap: 6px;
}

.notifications-toolbar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.notifications-toolbar__meta {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.notifications-toolbar__actions {
  display: flex;
  justify-content: flex-end;
}

.notifications-list {
  display: grid;
  gap: 12px;
}

.notifications-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 82%, transparent);
}

.notifications-item--success {
  border-color: color-mix(in oklab, #10b981 34%, var(--line));
}

.notifications-item--error {
  border-color: color-mix(in oklab, #ef4444 34%, var(--line));
}

.notifications-item--info {
  border-color: color-mix(in oklab, var(--accent-to) 30%, var(--line));
}

.notifications-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg-strong);
}

.notifications-item--success .notifications-item__icon {
  color: #10b981;
}

.notifications-item--error .notifications-item__icon {
  color: #ef4444;
}

.notifications-item--info .notifications-item__icon {
  color: var(--accent-to);
}

.notifications-item__icon .icon-svg {
  width: 22px;
  height: 22px;
}

.notifications-item__main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.notifications-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notifications-item__title-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notifications-item__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-strong);
}

.notifications-item__desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.notifications-item__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.notifications-item__badge,
.notifications-item__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--line);
}

.notifications-item__badge--success {
  color: #10b981;
  border-color: color-mix(in oklab, #10b981 40%, var(--line));
  background: rgba(16, 185, 129, 0.08);
}

.notifications-item__badge--error {
  color: #ef4444;
  border-color: color-mix(in oklab, #ef4444 40%, var(--line));
  background: rgba(239, 68, 68, 0.08);
}

.notifications-item__badge--info {
  color: var(--accent-to);
  border-color: color-mix(in oklab, var(--accent-to) 40%, var(--line));
  background: rgba(96, 165, 250, 0.08);
}

.notifications-item__count {
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.04);
}

.notifications-item__time {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--fg-muted);
}

.notifications-empty {
  display: grid;
  min-height: 300px;
  align-content: center;
  justify-items: center;
  padding: 32px 24px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.notifications-empty__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.notifications-empty__desc {
  margin-top: 8px;
  max-width: 42ch;
  text-align: center;
  line-height: 1.6;
  color: var(--fg-muted);
}

/* Team Analytics Empty State */
.team-analytics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  min-height: 60vh;
  animation: fadeIn 0.8s ease forwards;
}

.empty-state-visual {
  position: relative;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle {
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  border-radius: 30px; /* Squircle style */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
  box-shadow: 0 15px 35px rgba(244, 63, 94, 0.3);
  transform: rotate(-5deg);
  transition: transform 0.3s ease;
}

.team-analytics-empty:hover .icon-circle {
  transform: rotate(0deg) scale(1.05);
}

.icon-circle .icon-svg {
  font-size: 48px;
  color: #fff;
}

.pulse-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 2px solid var(--accent-from);
  border-radius: 50%;
  opacity: 0;
  animation: teamPulse 2.5s infinite;
}

@keyframes teamPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.empty-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--fg-strong);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.empty-desc {
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.empty-actions {
  display: flex;
  gap: 16px;
}

@media (max-width: 768px) {
  .team-analytics-empty {
    padding: 40px 16px;
  }
  .empty-title {
    font-size: 22px;
  }
  .empty-desc {
    font-size: 15px;
  }
}
/* =========================================
   8. TEAMS NEW COMPONENTS (Admin State)
   ========================================= */

/* =========================================
   8. TEAMS NEW COMPONENTS (Admin State)
   ========================================= */

.team-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Code Prefix "T" styling */
.code-cell--prefix {
  background-image: var(--accent-grad-vert);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 25px;
  border-radius: 12px;
  user-select: none;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.25);
  width: 42px;
  height: 48px;
}

/* Margin after applications */
.team-invite-card {
  margin-bottom: 16px;
}

.copy-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-btn:hover {
  background: var(--accent-grad);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.copy-btn:active {
  transform: translateY(0);
}

/* Admin Transfer Card (Dark per photo 3) */
.admin-transfer-card {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid var(--accent-from);
  padding: 24px;
  border-radius: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.admin-transfer-card h3 {
  font-family: var(--font-head);
  letter-spacing: 0.02em;
}

.admin-transfer-card .btn--accent {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  font-family: var(--font-head);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-from);
}

/* Member List */
.team-members-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 4px; /* Space for hover glows */
  margin-left: -4px;
  margin-right: -4px;
}

#team-subview-container {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.member-card {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 18px;
  gap: 16px;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}

.member-card:hover {
  border-color: transparent;
  transform: translateX(4px);
  background: linear-gradient(
    90deg,
    rgba(244, 63, 94, 0.2) 0%,
    rgba(245, 158, 11, 0.2) 100%
  );
  z-index: 2;
}

.member-card:hover::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Avatar with Instagram-style Ring */
.member-avatar-wrap {
  position: relative;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 20px;
  border: 2px solid transparent;
  position: relative;
  z-index: 2;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-weight: 600;
  color: var(--fg-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 17px;
}

.role-icon {
  font-size: 16px !important;
  color: #ffb800;
  filter: drop-shadow(0 0 4px rgba(255, 184, 0, 0.4));
}

.member-uid {
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  font-family: monospace;
}

.member-actions {
  display: flex;
  gap: 12px;
}

.btn-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-icon-sm:hover {
  background: var(--muted-2);
  color: var(--fg-strong);
  border-color: var(--border-2);
  transform: scale(1.05);
}

.btn-icon-sm--danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-from);
  border-color: rgba(244, 63, 94, 0.4);
}

.add-member-btn {
  width: 100%;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: transparent;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 16px;
  font-family: var(--font-head);
  letter-spacing: 0.05em;
  position: relative;
}

.add-member-btn:hover {
  border-color: transparent;
  color: var(--fg-strong);
  background: linear-gradient(
    90deg,
    rgba(244, 63, 94, 0.2) 0%,
    rgba(245, 158, 11, 0.2) 100%
  );
}

.add-member-btn:hover::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}

.team-separator {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* Team Footer */
.team-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-leave {
  color: var(--accent-from);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 15px;
  opacity: 0.7;
}

.btn-leave:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .team-info-grid {
    grid-template-columns: 1fr;
  }
}

.has-sub {
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
}

/* Member Me highlight */
.member-me {
  background: var(--accent-grad-vert);
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 13px;
  font-weight: 700;
}

/* Modal List Scrollbar */
.team-members-list::-webkit-scrollbar {
  width: 4px;
}
.team-members-list::-webkit-scrollbar-track {
  background: transparent;
}
.team-members-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* Confirm Modal specific */
#confirmModal .modal__panel {
  border: 1px solid var(--border);
  background: var(--bg-1) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

:root:not([data-theme="light"]) #confirmModal .modal__panel {
  background: #0d1425 !important;
  border-color: rgba(255, 255, 255, 0.1);
}

#confirmExtra {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

#confirmExtra:empty {
  display: none;
}

/* Danger modal style (isDanger = true) */
.modal--danger .modal__panel {
  border-color: var(--accent-from) !important;
  background: var(--bg-1) !important;
  box-shadow: 0 20px 50px rgba(244, 63, 94, 0.15);
}

:root:not([data-theme="light"]) .modal--danger .modal__panel {
  background: #0f101a !important;
}

.modal--danger .modal__title {
  color: var(--accent-from) !important;
}

.modal--danger #confirmIcon {
  color: var(--accent-from);
  font-size: 24px;
  font-variation-settings: "FILL" 1;
}

.modal--danger #confirmBtn {
  background-image: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  color: #fff !important;
  font-weight: 800;
}

/* Report Reasons Buttons */
.reason-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reason-btn {
  padding: 14px 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  border-style: dashed;
}

:root[data-theme="light"] .reason-btn {
  background: rgba(0, 0, 0, 0.02);
}

.reason-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-strong);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

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

.reason-btn.active {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--accent-from);
  color: var(--accent-from);
  border-style: solid;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.1);
}

/* Leave Team Link */
.leave-link {
  color: #f43f5e;
  font-size: 14px;
  text-decoration: none;
  font-family: var(--font-head);
  letter-spacing: 0.02em;
  opacity: 0.7;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-block;
}

.leave-link:hover {
  opacity: 1;
  text-shadow: 0 0 8px rgba(244, 63, 94, 0.3);
}

.team-leave-wrap {
  text-align: left;
  padding-top: 12px;
}

.member-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 16px;
  opacity: 0.5;
}

/* ==========================================================================
   TEAM ANALYTICS STYLES
   ========================================================================== */

.analytics-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 40px;
}

/* Base Analytics Card (Solid, not glass) */
.analytics-card {
  background: var(--bg-dark); /* Solid dark background from design */
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Grids */
.analytics-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.analytics-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.analytics-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.stat-card.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 250px; /* Increased to accommodate content and keep lines aligned */
  padding: 24px 20px;
}

/* Container for top content to align the divider */
.stat-card.centered .stat-top-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.stat-card.centered.no-hover {
  cursor: default;
}

.stat-card.centered .stat-icon-box {
  margin-bottom: 20px;
  transform: scale(1.1);
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 24px;
}

.stat-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.stat-icon-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(12px);
  opacity: 0.4;
  z-index: -1;
  border-radius: inherit;
}

/* Semi-transparent icon backgrounds */
.bg-orange-soft {
  background: rgba(245, 158, 11, 0.1);
}
.bg-pink-soft {
  background: rgba(244, 63, 94, 0.1);
}
.bg-green-soft {
  background: rgba(16, 185, 129, 0.1);
}
.bg-blue-soft {
  background: rgba(59, 130, 246, 0.1);
}

.text-orange-icon {
  color: #f59e0b;
}
.text-pink-icon {
  color: #f43f5e;
}
.text-green-icon {
  color: #10b981;
}
.text-blue-icon {
  color: #3b82f6;
}

.stat-footer {
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

/* Progress bar in stat card */
.stat-footer-alt {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 1. Glow Progress (Card 1) */
.glow-progress {
  width: 85%;
  height: 6px;
  background: var(--muted);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 4px;
}

.glow-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: inherit;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.stat-hint {
  font-size: 11px;
  color: var(--fg-muted);
}

/* 2. Simple Trend - Now as a Pill Badge (Card 2) */
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.15);
  color: var(--green);
  margin-top: 5px;
}

.trend-pill.trend-down {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.15);
  color: var(--accent-from);
}

.trend-pill .icon-svg {
  font-size: 14px;
}

/* 3. Bar Rows (Card 3) */
.bar-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 20px;
}

.bar-row__value {
  min-width: 32px;
  text-align: right;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
}

.bar-row .r {
  font-size: 11px;
  font-weight: 800;
  color: var(--fg-muted);
  min-width: 24px;
}

.bar-row .b {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.bar-row .f {
  height: 100%;
  border-radius: inherit;
}

.bar-row .f.gold {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}
.bar-row .f.silver {
  background: linear-gradient(90deg, #e2e8f0, #94a3b8);
}
.bar-row .f.bronze {
  background: linear-gradient(90deg, #d97706, #92400e);
}

/* 4. Split Stats (Card 4) */
.split-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}

.s-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.s-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
}

.s-item .v {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-head);
}

.s-item .l {
  font-size: 10px;
  color: var(--fg-muted);
  font-weight: 700;
  margin-top: 4px;
}

/* Compact Badge Trends (only for 3-grid detail cards) */
.analytics-grid-3 .trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 30px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.analytics-grid-3 .trend-up {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.analytics-grid-3 .trend-down {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.15);
  color: var(--accent-from);
}

.trend .icon-svg {
  font-size: 14px;
}

/* Top 3 Progress bar list */
.top3-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top3-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top3-item .rank {
  font-size: 12px;
  font-weight: 700;
  width: 20px;
}

.top3-item .bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.top3-item .bar-fill {
  height: 100%;
  border-radius: 10px;
}

.bg-orange {
  background: #f59e0b;
}
.bg-gray {
  background: #94a3b8;
}
.bg-bronze {
  background: #d97706;
}

.small-stats-row {
  display: flex;
  gap: 16px;
}

.small-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding-right: 12px;
}

.small-stat-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.small-stats-row::-webkit-scrollbar {
  display: none;
}

.small-stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: max-content;
}

.small-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.small-stat-content .label {
  font-size: 12px;
  color: var(--fg-muted);
}

.small-stat-content .value {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-head);
}

.small-stat-item .trend {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.chart-title {
  margin: 0;
  font-size: 18px;
  font-family: var(--font-head);
}

.chart-periods {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.period-btn {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--font-head);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.period-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.period-btn.active {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.chart-container {
  min-height: 400px;
}

.performance-chart-svg {
  width: 100%;
  height: auto;
}

.axis-labels text {
  fill: var(--fg-muted);
  font-size: 12px;
}

/* Best Tour Card (Right side) */
.best-tour-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.15) 0%,
    rgba(245, 158, 11, 0.15) 100%
  );
  border: 1px solid rgba(244, 63, 94, 0.4);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .best-tour-card {
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.14) 0%,
    rgba(245, 158, 11, 0.14) 100%
  );
  border-color: rgba(244, 63, 94, 0.25);
}

.card-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--accent-from) 0%, transparent 70%);
  opacity: 0.15;
  filter: blur(30px);
  pointer-events: none;
}

.tour-visual {
  margin: 32px 0;
}

.tour-medal {
  width: 100px;
  height: 100px;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.15),
    rgba(245, 158, 11, 0.05)
  );
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(245, 158, 11, 0.1);
}

.tour-medal::after {
  content: "";
  position: absolute;
  inset: -15px;
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.15) 0%,
    transparent 70%
  );
  z-index: -1;
}

.tour-medal .icon-svg {
  font-size: 48px;
  color: var(--accent-to);
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.5));
}

.best-tour-card .tour-name {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.best-tour-card .tour-date {
  font-size: 13px;
  color: var(--fg-muted);
}

.tour-stats-list {
  width: 100%;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.01);
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.t-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}

.t-stat:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.t-stat span:first-child {
  color: var(--fg-muted);
  font-weight: 600;
}

.t-stat .val {
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-head);
  color: var(--fg);
}

.t-stat .val.text-green {
  color: var(--green);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

/* Results Table */
.results-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.results-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-glass);
}

.results-table td {
  padding: 20px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table .tour-name-cell {
  font-weight: 600;
  color: var(--fg);
}

.results-table .date-cell,
.results-table .rank-cell {
  color: var(--fg-muted);
}

.results-table .points-cell {
  font-weight: 700;
  text-align: right;
}

/* Text colors helper */
.text-green {
  color: var(--green);
}
.text-danger {
  color: var(--accent-from);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .analytics-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .analytics-grid-4 {
    grid-template-columns: 1fr;
  }
  .analytics-main-grid {
    grid-template-columns: 1fr;
  }
  .analytics-grid-3 {
    grid-template-columns: 1fr;
  }

  .stat-card.centered .stat-value {
    font-size: 32px;
  }
}

@media (max-width: 380px) {
  .analytics-layout {
    gap: 16px;
  }
  .analytics-card {
    padding: 20px 16px;
  }
  .stat-card.centered .stat-value {
    font-size: 28px;
  }
}

/* ==========================================================================
   TEAM SECTION — RESPONSIVE ADAPTATION (down to 320px)
   ========================================================================== */

/* ——— 900px: medium tablets ——— */
@media (max-width: 900px) {
  /* Owner description + admin-transfer grid (inline style override) */
  #team-subview-container > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ——— 768px: tablets / mobile sidebar ——— */
@media (max-width: 768px) {
  .team-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tabs-nav {
    gap: 0;
  }

  .tab-item {
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
  }

  .tab-text {
    font-size: 13px;
  }

  /* Team action cards (create / join) */
  .team-actions-grid {
    grid-template-columns: 1fr;
  }

  .team-action-card {
    padding: 24px;
  }

  /* Team section head */
  .team-section-title {
    font-size: 20px;
  }

  .team-section-desc {
    font-size: 14px;
  }

  /* Member card */
  .member-card {
    padding: 12px 16px;
    gap: 12px;
  }

  .member-name {
    font-size: 15px;
    flex-wrap: wrap;
  }

  /* Team footer (owner) — inline style override */
  .team-footer {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
  }

  .team-footer .btn--accent {
    min-width: unset !important;
    width: 100%;
  }

  .team-footer .leave-link {
    text-align: center;
    order: 2;
  }

  .team-footer .btn--accent {
    order: 1;
  }

  /* Admin transfer card */
  .admin-transfer-card {
    padding: 20px;
  }

  /* Chart periods (analytics) */
  .chart-periods {
    flex-wrap: wrap;
  }

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

  /* Best tour card */
  .tour-medal {
    width: 80px;
    height: 80px;
  }

  .tour-medal .icon-svg {
    font-size: 40px;
  }

  .best-tour-card .tour-name {
    font-size: 18px;
  }
}

/* ——— 600px: large phones ——— */
@media (max-width: 600px) {
  .team-view {
    padding-left: 12px;
    padding-right: 12px;
  }

  .dash-header {
    font-size: 24px;
  }

  .team-action-card {
    padding: 20px;
    gap: 16px;
    border-radius: 20px;
  }

  .action-title {
    font-size: 16px;
  }

  .action-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .btn--wide {
    max-width: 100%;
  }

  /* Member card responsive */
  .member-card {
    padding: 12px;
    border-radius: 14px;
    gap: 10px;
  }

  .member-name {
    font-size: 14px;
    gap: 4px;
  }

  .member-uid {
    font-size: 10px;
  }

  .member-actions {
    gap: 8px;
  }

  .btn-icon-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .btn-icon-sm .icon-svg {
    font-size: 18px;
  }

  /* Add member button */
  .add-member-btn {
    padding: 16px;
    font-size: 14px;
    border-radius: 14px;
  }

  /* Compose (owner in-team) roster heading */
  .team-section-head[data-view-anim] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  /* Team info inputs */
  .team-info-grid .field label {
    font-size: 13px;
  }

  .team-info-grid .input {
    font-size: 14px;
  }

  /* Results table */
  .results-table th,
  .results-table td {
    padding: 12px 10px;
    font-size: 12px;
  }

  .results-table .tour-name-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Stat card adjustments */
  .stat-card.centered {
    min-height: 220px;
    padding: 20px 16px;
  }

  .stat-icon-box {
    width: 42px;
    height: 42px;
  }

  .stat-label {
    font-size: 11px;
  }

  /* Small stat cards */
  .small-stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-right: 0;
  }

  .small-stat .trend {
    align-self: flex-end;
  }

  /* Chart container height */
  .chart-container {
    min-height: 300px;
  }

  .chart-box {
    height: 220px !important;
  }
}

/* ——— 480px: small phones ——— */
@media (max-width: 480px) {
  .team-view {
    padding-left: 8px;
    padding-right: 8px;
  }

  .team-invite-card {
    padding: 16px;
    border-radius: 18px;
    margin: 20px 0 10px 0;
  }

  .invite-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .invite-icon-box .icon-svg {
    font-size: 22px;
  }

  .invite-title {
    font-size: 14px;
    line-height: 20px;
  }

  .invite-desc {
    font-size: 12px;
  }

  /* Owner description + admin-transfer */
  .admin-transfer-card {
    padding: 16px;
    border-radius: 14px;
    gap: 12px;
  }

  .admin-transfer-card h3 {
    font-size: 14px !important;
  }

  .admin-transfer-card p {
    font-size: 12px !important;
  }

  /* Team footer */
  .team-footer .btn--accent {
    padding: 12px !important;
    font-size: 14px;
  }

  /* Member avatar  */
  .profile-avatar {
    width: 36px;
    height: 36px;
  }

  .avatar-letter {
    font-size: 15px;
  }

  /* Tab text */
  .tab-item .icon {
    font-size: 18px;
  }

  .tab-text {
    font-size: 12px;
  }

  /* Analytics */
  .stat-card.centered {
    min-height: 200px;
  }

  .stat-value {
    font-size: 30px;
    margin-bottom: 16px;
  }

  .stat-card.centered .stat-icon-box {
    transform: scale(1);
    margin-bottom: 14px;
  }

  .glow-progress {
    width: 100%;
  }

  /* Bar rows */
  .bar-row {
    padding: 0 8px;
  }

  /* Best tour card */
  .best-tour-card {
    padding: 20px 16px;
  }

  .tour-visual {
    margin: 20px 0;
  }

  .tour-medal {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .tour-medal .icon-svg {
    font-size: 36px;
  }

  .best-tour-card .tour-name {
    font-size: 16px;
  }

  /* Period buttons */
  .period-btn {
    padding: 5px 10px;
    font-size: 10px;
  }

  /* Split stats (card 4) */
  .s-item .v {
    font-size: 16px;
  }

  .s-item .l {
    font-size: 9px;
  }

  /* Table adjustments */
  .results-table .date-cell {
    display: none;
  }
}

/* ——— 380px: very narrow screens ——— */
@media (max-width: 380px) {
  .team-action-card {
    padding: 16px;
    gap: 12px;
    border-radius: 16px;
  }

  .action-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .action-icon-box span,
  .action-icon-box .icon-svg {
    font-size: 20px;
  }

  .action-title {
    font-size: 15px;
  }

  .action-desc {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .team-section-title {
    font-size: 18px;
  }

  .team-section-desc {
    font-size: 13px;
  }

  .member-card {
    padding: 10px;
    border-radius: 12px;
    gap: 8px;
  }

  .member-name {
    font-size: 13px;
  }

  .member-me {
    font-size: 11px;
  }

  .member-uid {
    font-size: 9px;
  }

  .member-actions {
    gap: 6px;
  }

  .btn-icon-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .btn-icon-sm .icon-svg {
    font-size: 16px;
  }

  .add-member-btn {
    padding: 14px;
    gap: 8px;
    font-size: 13px;
  }

  /* Team info grid fields */
  .team-info-grid {
    gap: 14px;
    margin-bottom: 18px;
  }

  .copy-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .copy-btn .icon-svg {
    font-size: 18px;
  }

  /* Tabs */
  .tabs-nav {
    margin-bottom: 8px;
  }

  /* Empty state */
  .empty-title {
    font-size: 20px;
  }

  .empty-desc {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 24px;
  }

  .icon-circle .icon-svg {
    font-size: 40px;
  }

  .pulse-ring {
    width: 120px;
    height: 120px;
  }

  /* Analytics cards */
  .stat-card.centered .stat-value {
    font-size: 26px;
  }

  .trend-pill {
    padding: 4px 10px;
    font-size: 10px;
  }

  .stat-hint {
    font-size: 10px;
  }

  /* Small stats */
  .small-stat-content .label {
    font-size: 11px;
  }

  .small-stat-content .value {
    font-size: 16px;
  }

  .small-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .small-stat-icon .icon-svg {
    font-size: 18px;
  }

  /* Tour stats list */
  .tour-stats-list {
    padding: 10px;
  }

  .t-stat {
    font-size: 12px;
  }

  .t-stat .val {
    font-size: 13px;
  }
}

/* ——— 320px: minimum supported width ——— */
@media (max-width: 320px) {
  .team-view {
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 24px;
  }

  .team-invite-card {
    padding: 12px;
    border-radius: 14px;
    gap: 12px;
    margin: 16px 0 8px 0;
  }

  .invite-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .invite-icon-box .icon-svg {
    font-size: 18px;
  }

  .invite-title {
    font-size: 13px;
    line-height: 18px;
  }

  .invite-desc {
    font-size: 11px;
    line-height: 16px;
  }

  .invite-actions .btn {
    padding: 8px 12px !important;
    font-size: 12px;
  }

  .team-action-card {
    padding: 14px;
    gap: 10px;
    border-radius: 14px;
  }

  .action-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .action-icon-box span,
  .action-icon-box .icon-svg {
    font-size: 18px;
  }

  .action-title {
    font-size: 14px;
  }

  .action-desc {
    font-size: 11px;
    margin-bottom: 12px;
    line-height: 1.5;
  }

  .btn--wide {
    height: 40px;
    font-size: 13px;
  }

  .team-section-title {
    font-size: 16px;
  }

  .team-section-desc {
    font-size: 12px;
  }

  .team-section-head {
    margin-bottom: 16px;
  }

  .member-card {
    padding: 8px;
    border-radius: 10px;
    gap: 6px;
  }

  .member-name {
    font-size: 12px;
    flex-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .member-me {
    font-size: 10px;
  }

  .member-uid {
    font-size: 8px;
  }

  .member-info {
    overflow: hidden;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }

  .avatar-inner {
    border-radius: 11px;
  }

  .avatar-letter {
    font-size: 13px;
  }

  /* Team code grid in modal */
  .team-code-grid {
    grid-template-columns: repeat(10, 28px);
    gap: 3px;
  }

  .team-code-grid .code-cell {
    width: 28px;
    height: 36px;
    font-size: 18px;
    border-radius: 8px;
  }

  .team-code-grid .code-cell--prefix {
    border-radius: 8px;
  }

  .add-member-btn {
    padding: 12px;
    font-size: 12px;
    gap: 6px;
    border-radius: 10px;
  }

  .team-info-grid {
    gap: 10px;
    margin-bottom: 14px;
  }

  .copy-btn {
    width: 32px;
    height: 32px;
  }

  .admin-transfer-card {
    padding: 12px;
    border-radius: 12px;
  }

  .tab-item {
    padding: 8px 4px;
  }

  .tab-text {
    font-size: 11px;
  }

  .tab-item .icon {
    font-size: 16px;
  }

  /* Analytics at 320px */
  .analytics-layout {
    gap: 12px;
  }

  .analytics-card {
    padding: 16px 12px;
    border-radius: 18px;
  }

  .stat-card.centered {
    min-height: 180px;
    padding: 16px 12px;
  }

  .stat-card.centered .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .stat-icon-box .icon-svg {
    font-size: 20px;
  }

  .stat-footer-alt {
    padding-top: 14px;
    gap: 8px;
  }

  .chart-container {
    min-height: 260px;
  }

  .chart-box {
    height: 180px !important;
  }

  .chart-title {
    font-size: 15px;
  }

  .period-btn {
    padding: 4px 8px;
    font-size: 9px;
  }

  .chart-periods {
    padding: 2px;
    gap: 2px;
  }

  .best-tour-card {
    padding: 16px 12px;
  }

  .tour-visual {
    margin: 16px 0;
  }

  .tour-medal {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .tour-medal .icon-svg {
    font-size: 32px;
  }

  .best-tour-card .tour-name {
    font-size: 15px;
  }

  .best-tour-card .tour-date {
    font-size: 12px;
  }

  .results-table th {
    font-size: 9px;
    padding: 8px 6px;
  }

  .results-table td {
    font-size: 11px;
    padding: 10px 6px;
  }

  .results-table .tour-name-cell {
    max-width: 90px;
  }

  /* Empty state */
  .team-analytics-empty {
    padding: 30px 8px;
    min-height: 40vh;
  }

  .empty-state-visual {
    margin-bottom: 24px;
  }

  .empty-title {
    font-size: 18px;
  }

  .empty-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .empty-actions .btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

/* PROFILE SECTION - NEW DESIGN */
.profile-view {
  padding-bottom: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.profile-head-header {
  font-size: 32px;
  font-weight: 300;
  margin-bottom: 32px;
  margin-top: 0;
  color: var(--fg-strong);
  font-family: var(--font-head);
}

.profile-nav-tabs {
  display: flex;
  gap: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
  padding-bottom: 2px;
}

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.profile-nav-item .icon-svg {
  font-size: 20px;
}

.profile-nav-item:hover {
  color: var(--fg);
}

.profile-nav-item.active {
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom-color: var(--accent-from);
}

.profile-nav-item.active .icon-svg {
  fill: url(#navGradient) !important;
  color: transparent;
}

/* User Info Bar */
.profile-user-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
}

.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.3),
    rgba(245, 158, 11, 0.3)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.profile-avatar-large .avatar-visual {
  width: 70px;
  height: 70px;
  background: #e2e2e2;
  clip-path: circle(50% at 50% 50%); /* Simplified avatar shape from SVG */
  mask: url("data:image/svg+xml,%3Csvg width='70' height='70' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0C22.4 0 0 22.4 0 50s22.4 50 50 50 50-22.4 50-50S77.6 0 50 0zm0 15c8.3 0 15 6.7 15 15s-6.7 15-15 15-15-6.7-15-15 6.7-15 15-15zm0 75c-11.8 0-22.5-4.8-30.2-12.6 2.3-10.4 11.6-18.4 22.7-18.4h14.9c11.1 0 20.4 8 22.7 18.4-7.7 7.8-18.4 12.6-30.1 12.6z'/%3E%3C/svg%3E")
    no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='70' height='70' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0C22.4 0 0 22.4 0 50s22.4 50 50 50 50-22.4 50-50S77.6 0 50 0zm0 15c8.3 0 15 6.7 15 15s-6.7 15-15 15-15-6.7-15-15 6.7-15 15-15zm0 75c-11.8 0-22.5-4.8-30.2-12.6 2.3-10.4 11.6-18.4 22.7-18.4h14.9c11.1 0 20.4 8 22.7 18.4-7.7 7.8-18.4 12.6-30.1 12.6z'/%3E%3C/svg%3E")
    no-repeat center;
}

/* Fallback letter if no image */
.profile-avatar-large .avatar-placeholder {
  width: 60px;
  height: 60px;
  background: #d1d5db;
  border-radius: 18px 18px 4px 4px;
  position: relative;
}

.profile-user-meta {
  flex: 1;
}

.profile-fullname {
  font-size: 28px;
  font-weight: 500;
  margin: 0;
  color: var(--fg-strong);
}

.profile-uid-label {
  color: var(--fg-muted);
  font-size: 16px;
  margin-top: 4px;
}

.btn-upload-photo {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-muted);
  padding: 12px 24px;
  /* border-radius: 99px; */
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-upload-photo:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
}
.btn-upload-photo.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Form Container */
.profile-form-container {
  background: #11141d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 48px;
}

:root[data-theme="light"] .profile-form-container {
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  border-color: var(--border);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.profile-new-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}

.profile-new-grid .field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-new-grid label {
  font-size: 14px;
  color: var(--fg-muted);
  font-weight: 500;
}

.profile-new-grid .input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--fg);
  font-size: 15px;
  transition: all 0.2s ease;
}

:root[data-theme="light"] .profile-new-grid .input {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--fg);
}

.profile-new-grid .input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-from);
  outline: none;
}

:root[data-theme="light"] .profile-new-grid .input:focus {
  background: rgba(255, 255, 255, 0.86);
}
.profile-new-grid .field .error {
  min-height: 16px;
  margin-top: -4px;
}
.avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Footer Actions */
.profile-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
}

.role-preview-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-logout-link {
  color: #f43f5e;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: opacity 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.btn-logout-link:hover {
  opacity: 0.8;
}

.btn-save-large {
  background: linear-gradient(90deg, #f43f5e 0%, #f59e0b 100%);
  color: #000;
  border: none;
  padding: 16px 40px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}
.btn-save-large.is-disabled,
.btn-save-large:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-save-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.4);
}

.btn-save-large:active {
  transform: translateY(0);
}

@media (max-width: 900px) {
  .profile-new-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .profile-new-grid {
    grid-template-columns: 1fr;
  }
  .profile-user-bar {
    flex-direction: column;
    text-align: center;
  }
  .profile-footer-row {
    flex-direction: column;
    gap: 24px;
  }
  .btn-save-large {
    width: 100%;
  }
}

.profile-avatar.large {
  width: 100px;
  height: 100px;
}

.profile-avatar.large .avatar-inner {
  width: 98px;
  height: 98px;
}

.profile-avatar.large .avatar-letter {
  font-size: 48px;
}
/* Input Changed State (Gradient Border) */
.input.is-changed {
  border-color: transparent;
  background-image:
    linear-gradient(var(--bg-dark), var(--bg-dark)),
    linear-gradient(90deg, var(--accent-from), var(--accent-to));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
}

/* Autocomplete Dropdown */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
}

.autocomplete-dropdown.visible {
  display: block;
}

.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg);
  transition: background 0.2s;
}

.autocomplete-item:hover {
  background: var(--muted);
}

.autocomplete-item strong {
  color: var(--accent-from);
}

/* Button Disabled State (Explicit) */
.btn.is-disabled {
  background: var(--muted);
  color: var(--fg-muted);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  pointer-events: none;
}

/* =========================================
   VALIDATION & AUTOCOMPLETE UI
   ========================================= */

#profile-detailed-form .field {
  position: relative;
  margin-bottom: 28px;
}

#profile-detailed-form .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.input {
  width: 100%;
  font-family: var(--font-body);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Стилизация инпутов только в профиле */
#profile-detailed-form .input {
  padding: 12px 16px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--fg);
  font-size: 16px;
  font-family: var(--font-body);
}

.input:focus {
  outline: none;
  border-color: var(--accent-from);
  background: var(--muted-2);
}

/* Красивый фокус только в профиле */
#profile-detailed-form .input:focus {
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent-from) 15%, transparent);
}

#profile-detailed-form .input.is-changed {
  border-color: transparent !important;
  background-origin: border-box;
  background-clip: padding-box, border-box !important;
  background-image:
    linear-gradient(var(--bg-1), var(--bg-1)), var(--accent-grad);
  border: 1px solid transparent;
}

#profile-detailed-form .input.is-invalid {
  border-color: #ff4757 !important;
  background: color-mix(in oklab, #ff4757 5%, transparent);
}

#profile-detailed-form .field-error {
  position: absolute;
  bottom: -18px;
  left: 4px;
  font-size: 11px;
  color: #ff4757;
  font-weight: 600;
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}

#profile-detailed-form .field:has(.is-invalid) .field-error {
  opacity: 1;
  transform: translateY(0);
}

/* Autocomplete Premium Look */
.autocomplete-wrap {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: color-mix(in oklab, var(--bg-1) 95%, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
}

.autocomplete-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg);
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.focused {
  background: var(--accent-grad) !important;
  color: #fff !important;
  font-weight: 800;
  padding-left: 20px;
}

.autocomplete-item strong {
  color: var(--accent-from);
  font-weight: 700;
}

/* Phone Mask Hint */
.input-hints {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.hint-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--muted);
  border-radius: 4px;
  color: var(--fg-muted);
}

.autocomplete-item.focused {
  background: var(--accent-grad) !important;
  color: #0b1220 !important;
  font-weight: 800;
  padding-left: 20px;
}

.autocomplete-item.focused strong,
.autocomplete-item:hover strong {
  color: #fff !important;
}

/* --- SVG Icons --- */
.icon-svg {
  font-size: 24px;
  line-height: 1;
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em; /* Compensate for descender just like text */
  fill: currentColor;
  flex-shrink: 0;
  transition:
    color 0.2s ease,
    fill 0.2s ease;
}

/* SVG Fill Toggles (Replacing Font FILL property) */
.nav-item:hover:not(.active) .icon-svg .svg-outline,
.card-icon .svg-outline,
.icon-svg.fill-active .svg-outline,
.nav-item.active .icon-svg .svg-outline {
  display: none !important;
}

.nav-item:hover:not(.active) .icon-svg .svg-filled,
.card-icon .svg-filled,
.icon-svg.fill-active .svg-filled,
.nav-item.active .icon-svg .svg-filled {
  display: unset !important;
}

.text-black {
  color: #000 !important;
  fill: #000 !important;
  -webkit-text-fill-color: initial !important;
  background-clip: border-box !important;
}

.tab-item.active .icon-svg {
  fill: url(#navGradient) !important;
  background: none !important;
  color: transparent !important;
  -webkit-text-fill-color: initial !important;
  background-clip: border-box !important;
}

.tab-item .icon-svg {
  color: inherit;
  transition: inherit;
  fill: currentColor;
}

.action-icon-box svg {
  color: #000 !important;
  fill: #000 !important;
  stroke: #000 !important;
}

/* --- Toggle Switch --- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.05);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--border);
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 1px;
  background-color: var(--fg-muted);
  transition: 0.3s;
  border-radius: 50%;
}
.switch input:checked + .switch-slider {
  background: var(--accent-grad);
  border-color: transparent;
}
.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

/* --- Profile Security & Analytics --- */
.profile-section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--fg);
}
.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 900px) {
  .security-grid {
    grid-template-columns: 1fr;
  }
}
.security-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.security-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.security-setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.security-setting-info .title {
  font-weight: 500;
  margin-bottom: 4px;
}
.security-setting-info .desc {
  font-size: 13px;
  color: var(--fg-muted);
}
.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.session-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.session-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
}
.session-info-main {
  display: flex;
  align-items: center;
}
.session-details .device {
  font-weight: 500;
  margin-bottom: 4px;
}
.session-details .meta {
  font-size: 13px;
  color: var(--fg-muted);
}
.session-actions .btn {
  padding: 6px 16px;
  font-size: 13px;
}
.btn-logout-all {
  margin-top: 16px;
  width: 100%;
}

/* --- True Profile Security Layout --- */
.security-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px;
}
.security-card-full {
  background: #111115;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  min-width: 300px;
  flex: 1 1 500px;
}
.security-grid-bot {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  width: 100%;
}
.security-grid-bot > * {
  flex: 1 1 300px;
}
.sec-header {
  margin-bottom: 32px;
}
.sec-header-border {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 24px;
}

.sec-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 8px 0;
}
.sec-desc {
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0;
}
.sec-pass-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}
.sec-pass-row-new {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}
.pass-group-col {
  flex: 1 1 calc(33.333% - 24px);
  min-width: 200px;
}
.input-sec {
  background: #16161b;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  padding-right: 48px !important; /* Make room for icon */
}

:root[data-theme="light"] .input-sec {
  background: rgba(15, 23, 42, 0.045);
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: var(--fg);
}

:root[data-theme="light"] .input-sec:focus {
  background: rgba(255, 255, 255, 0.9);
}
.input-group-sec .input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #1c1c22;
  border-radius: 8px;
  width: 32px;
  height: 32px;
}

:root[data-theme="light"] .input-group-sec .input-toggle {
  background: rgba(15, 23, 42, 0.055);
  border-color: rgba(15, 23, 42, 0.08);
}
.sec-pass-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.sec-pass-footer-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sec-pass-footer .btn {
  width: 100%;
}
.sec-link {
  color: var(--fg-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}
.sec-link:hover {
  color: var(--fg);
}
.sec-list {
  display: flex;
  flex-direction: column;
}
.sec-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sec-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.sec-list-item:first-child {
  padding-top: 0;
}
.session-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.session-icon {
  width: 40px;
  height: 40px;
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 8px;
}
.sec-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.s-title {
  font-size: 15px;
  color: var(--fg);
  font-weight: 500;
}
.s-sub {
  font-size: 13px;
  color: var(--fg-muted);
}
.text-warning {
  color: #10b981; /* Green */
}
.btn-text {
  background: #1c1c22;
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
}

:root[data-theme="light"] .btn-text {
  background: rgba(15, 23, 42, 0.055);
  color: var(--fg-muted);
}
.btn-text:hover {
  color: var(--fg);
  background: #25252a;
}

:root[data-theme="light"] .security-card,
:root[data-theme="light"] .security-card-full {
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  border-color: var(--border);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .sec-header-border,
:root[data-theme="light"] .sec-pass-footer-new,
:root[data-theme="light"] .sec-list-item {
  border-color: var(--border);
}

:root[data-theme="light"] .btn-text:hover {
  background: rgba(15, 23, 42, 0.09);
  color: var(--fg);
}
.text-danger {
  color: var(--danger, #ef4444);
}
.sec-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 24px;
}
.sec-footer-text {
  font-size: 14px;
  color: var(--fg-muted);
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.gap-24 {
  gap: 24px;
}

/* Role workspaces */
.ops-view {
  display: grid;
  gap: 24px;
  padding-bottom: 40px;
}

.ops-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: var(--space-lg);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.ops-header__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(24px, 5vw, 36px);
  color: var(--fg-strong);
}

.ops-header__subtitle {
  margin: 8px 0 0;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .ops-shell--aside,
  .ops-shell--editor,
  .ops-shell--composer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  :root {
    --radius: 12px;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
  }
  .ops-header,
  .ops-panel,
  .ops-editor-shell,
  .ops-view {
    padding: var(--space-sm);
    gap: var(--space-sm);
  }
  .ops-header__title {
    font-size: 22px;
  }
}

.ops-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background-image: var(--accent-grad);
  pointer-events: none;
}

.ops-header__copy {
  display: grid;
  gap: 10px;
  max-width: 66ch;
}

.ops-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ops-metric-grid {
  display: grid;
  gap: 16px;
}

.ops-metric-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-metric-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-metric-grid--six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ops-metric-card {
  gap: 18px;
  min-height: 148px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-color: var(--border);
  transition:
    border-color 0.22s ease,
    background 0.22s ease;
}

.ops-metric-card:hover {
  border-color: color-mix(in oklab, var(--accent-to) 28%, var(--border));
  background: color-mix(in oklab, var(--bg-1) 88%, transparent);
}

.ops-metric-card__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ops-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 72%, transparent);
  color: var(--fg);
  flex-shrink: 0;
}

.ops-icon .icon-svg {
  width: 22px;
  height: 22px;
}

.ops-icon--accent {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 24%, transparent),
    color-mix(in oklab, var(--accent-to) 20%, transparent)
  );
  color: var(--accent-to);
}

.ops-icon--warning {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-to) 24%, transparent),
    color-mix(in oklab, #fbbf24 16%, transparent)
  );
  color: var(--warning);
}

.ops-icon--danger {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 24%, transparent),
    color-mix(in oklab, #ef4444 16%, transparent)
  );
  color: var(--danger);
}

.ops-icon--muted {
  color: var(--fg-muted);
}

.ops-metric-card__copy {
  display: grid;
  gap: 8px;
}

.ops-metric-card__label {
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 600;
}

.ops-metric-card__value {
  font-family: var(--font-head);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  color: var(--fg-strong);
}

.ops-metric-card__meta {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: auto;
}

.ops-shell {
  display: grid;
  gap: 18px;
}

.ops-shell--aside {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
  align-items: start;
}

.ops-shell--editor {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  align-items: start;
}

.ops-shell--composer {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  align-items: start;
}

.ops-stack {
  display: grid;
  gap: 18px;
}

.ops-panel {
  gap: 18px;
  position: relative;
  overflow: hidden;
  border-color: var(--border);
}

.ops-panel--primary {
  padding: 28px;
}

.ops-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ops-panel__copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 200px;
}

.ops-panel__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fg-strong);
}

.ops-panel__desc {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.6;
}

.ops-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-panel__body {
  display: grid;
  gap: 16px;
  container-type: inline-size;
}

.ops-action-grid {
  display: grid;
  gap: 12px;
}

.ops-action-card {
  display: grid;
  gap: 10px;
  align-items: start;
  justify-items: start;
  text-align: left;
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
  color: var(--fg);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.ops-action-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent-to) 40%, var(--line));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.ops-action-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-action-card__desc {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.ops-flow-list {
  display: grid;
  gap: 16px;
}

.ops-flow-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.ops-flow-item__step {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 18%, transparent),
    color-mix(in oklab, var(--accent-to) 14%, transparent)
  );
}

.ops-sidebar {
  padding: 14px;
  max-height: calc(100vh - 210px);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
}

.ops-sidebar__toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
}

.ops-sidebar__toggle-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  color: var(--fg-muted);
}

.ops-sidebar.is-expanded .ops-sidebar__toggle-icon {
  transform: rotate(180deg);
}

.ops-sidebar__head {
  margin-bottom: 10px;
  flex-shrink: 0;
}

.ops-sidebar__head .ops-panel__title {
  font-size: 16px;
}

.ops-sidebar__head .ops-panel__desc {
  font-size: 12px;
  line-height: 1.5;
}

.ops-sidebar__body {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
  flex: 1;
  min-height: 0;
}

.ops-list-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 76%, transparent);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.ops-list-card:hover {
  border-color: color-mix(in oklab, var(--accent-from) 28%, var(--border));
}

.ops-list-card.is-active {
  border-color: color-mix(in oklab, var(--accent-to) 45%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 10%, var(--bg-1)),
    color-mix(in oklab, var(--accent-to) 8%, var(--bg-1))
  );
}

.ops-list-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ops-list-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-strong);
  line-height: 1.35;
}

.ops-list-card__meta {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ops-main {
  display: grid;
  gap: 18px;
  container-type: inline-size;
  container-name: ops-main;
}

.ops-editor-shell {
  padding: 22px;
  gap: 18px;
}

.ops-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ops-record-head__copy {
  display: grid;
  gap: 8px;
}

.ops-record-head__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
}

.ops-record-head__title {
  font-family: var(--font-head);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.05;
  color: var(--fg-strong);
}

.ops-record-head__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.ops-record-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-record-meta__item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: color-mix(in oklab, var(--bg-1) 74%, transparent);
  display: grid;
  gap: 6px;
}

.ops-record-meta__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.ops-record-meta__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-editor-content {
  display: grid;
  gap: 18px;
}

.ops-tabs {
  margin-bottom: 0;
}

.ops-tabs--editor {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ops-tabs--editor::-webkit-scrollbar {
  display: none;
}

.ops-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--muted-2);
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-item.active .ops-step-num {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
}

.ops-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in oklab, var(--bg-1) 60%, transparent);
}

.tab-item.active .ops-tab-count {
  color: #fff;
  background: var(--accent-from);
  border-color: transparent;
  font-weight: 700;
}

.ops-form-stack {
  display: grid;
  gap: 18px;
}

.ops-editor-hero-grid,
.ops-code-mode-grid,
.ops-step-actions {
  display: grid;
  gap: 14px;
}

.ops-editor-hero-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 240px);
  align-items: start;
}

.ops-editor-hero-grid > * {
  min-width: 0;
}

.ops-form-stack--main {
  min-width: 0;
}

.ops-code-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-form-grid {
  display: grid;
  gap: 14px;
}

.ops-form-grid--full,
.ops-form-grid--double,
.ops-form-grid--triple,
.ops-form-grid--quad {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.ops-form-grid--full > * {
  grid-column: span 12;
}

.ops-form-grid--double > * {
  grid-column: span 6;
}

.ops-form-grid--triple > * {
  grid-column: span 4;
}

.ops-form-grid--quad > * {
  grid-column: span 3;
}

@container (max-width: 460px) {
  .ops-editor-hero-grid {
    grid-template-columns: 1fr;
  }

  .ops-editor-summary-card {
    width: 100%;
  }
}

@container (max-width: 620px) {
  .ops-code-mode-grid,
  .ops-step-actions {
    grid-template-columns: 1fr;
  }

  .ops-form-grid--double > *,
  .ops-form-grid--triple > *,
  .ops-form-grid--quad > * {
    grid-column: 1 / -1;
  }
}

@container ops-main (max-width: 980px) {
  .ops-shell--aside {
    grid-template-columns: 1fr;
  }
}

.ops-field-wide {
  grid-column: span 12;
}

.ops-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 4px;
}

.ops-form-submit-wrap {
  display: flex;
  align-items: end;
}

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

.ops-toggle-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 76%, transparent);
  cursor: pointer;
}

.ops-toggle-card input {
  margin-top: 4px;
}

.ops-toggle-card__copy {
  display: grid;
  gap: 6px;
}

.ops-toggle-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-toggle-card__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.ops-toggle-card--compact {
  padding: 14px 16px;
}

.ops-editor-summary-card,
.ops-editor-phase-card,
.ops-category-picker {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 76%, transparent);
}

.ops-editor-summary-card__label,
.ops-editor-phase-card__label,
.ops-category-picker__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.ops-editor-summary-card__value,
.ops-editor-phase-card__value {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-editor-summary-card__hint,
.ops-editor-phase-card__meta {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.ops-category-picker {
  padding: 14px;
}

.ops-category-picker__selected,
.ops-category-picker__cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ops-category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-0) 60%, transparent);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.ops-category-chip:hover {
  border-color: color-mix(in oklab, var(--accent-to) 26%, var(--line));
}

.ops-category-chip.is-active,
.ops-category-chip--selected {
  border-color: color-mix(in oklab, var(--accent-to) 34%, var(--line));
  background: color-mix(in oklab, var(--accent-to) 18%, var(--bg-0));
  color: var(--fg-strong);
}

.ops-checklist {
  display: grid;
  gap: 12px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.ops-check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 76%, transparent);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.ops-check-item:hover {
  transform: translateY(-1px);
}

.ops-check-item.is-selected {
  border-color: color-mix(in oklab, var(--accent-to) 46%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 10%, var(--bg-1)),
    color-mix(in oklab, var(--accent-to) 8%, var(--bg-1))
  );
}

.ops-check-item__body {
  display: grid;
  gap: 6px;
}

.ops-check-item__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-participants-layout {
  display: grid;
  grid-template-columns: minmax(min(100%, 280px), 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.ops-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ops-inline-actions--stretch {
  align-items: end;
}

.ops-step-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.ops-step-actions .ops-inline-actions:last-child {
  justify-content: flex-end;
}

.ops-choice-card {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 76%, transparent);
  color: var(--fg);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

@media (max-width: 1360px) {
  .ops-shell--aside {
    grid-template-columns: 1fr;
  }

  .ops-participants-layout {
    grid-template-columns: 1fr;
  }
}

.ops-choice-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--accent-to) 28%, var(--line));
}

.ops-choice-card.is-active {
  border-color: color-mix(in oklab, var(--accent-to) 40%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 10%, var(--bg-1)),
    color-mix(in oklab, var(--accent-to) 8%, var(--bg-1))
  );
}

.ops-choice-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-choice-card__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.ops-preview-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 76%, transparent);
}

.ops-preview-card__summary,
.ops-preview-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-preview-card__errors {
  display: grid;
  gap: 6px;
  max-height: 170px;
  overflow: auto;
}

.ops-entity-list {
  display: grid;
  gap: 10px;
}

.ops-badge {
  --ops-badge-color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--ops-badge-color) 38%, var(--line));
  background: color-mix(in oklab, var(--ops-badge-color) 12%, transparent);
  color: var(--ops-badge-color);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ops-badge--inline {
  margin-left: 8px;
  vertical-align: middle;
}

.ops-badge--muted {
  --ops-badge-color: var(--fg-muted);
}

.ops-badge--accent {
  --ops-badge-color: var(--accent-to);
}

.ops-badge--warning {
  --ops-badge-color: var(--warning);
}

.ops-badge--danger {
  --ops-badge-color: var(--danger);
}

.ops-badge--success {
  --ops-badge-color: var(--ok);
}

.ops-badge--owner {
  --ops-badge-color: color-mix(in oklab, var(--accent-to) 68%, #f8fafc);
}

.ops-entity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.ops-entity-row.is-selected {
  border-color: color-mix(in oklab, var(--accent-to) 45%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 9%, var(--bg-1)),
    color-mix(in oklab, var(--accent-to) 7%, var(--bg-1))
  );
}

.ops-entity-row:hover {
  border-color: color-mix(in oklab, var(--accent-from) 24%, var(--border));
}

.ops-entity-row__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ops-entity-row__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-entity-row__meta {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.ops-entity-row__note {
  font-size: 13px;
  color: var(--fg);
  line-height: 1.5;
}

.ops-entity-row__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-empty-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 8px 0;
}

.ops-empty-state__visual .ops-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

.ops-empty-state__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-empty-state__desc {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 52ch;
}

.ops-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ops-divider {
  height: 1px;
  background: var(--line);
}

.ops-import-box {
  display: grid;
  gap: 12px;
}

.ops-import-box__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-import-box__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.ops-admin-list {
  display: grid;
  gap: 12px;
}

.ops-admin-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.ops-admin-row:hover {
  border-color: color-mix(in oklab, var(--accent-to) 22%, var(--border));
}

.ops-admin-row__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ops-admin-row__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-admin-row__controls .input {
  min-width: 148px;
  min-height: var(--control-h-sm);
  height: var(--control-h-sm);
  padding-top: 0;
  padding-bottom: 0;
}

.ops-admin-row__controls .btn {
  min-height: var(--control-h-sm);
}

.ops-timeline .sec-list-item {
  padding-inline: 0;
}

.ops-admin-overview-grid,
.ops-admin-chart-grid {
  display: grid;
  gap: 18px;
}

.ops-admin-overview-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(min(100%, 280px), 0.92fr);
  align-items: start;
}

.ops-admin-overview-grid--secondary,
.ops-admin-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-admin-kpi-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 80%, transparent);
}

.ops-admin-kpi-card--accent {
  border-color: color-mix(in oklab, var(--accent-to) 22%, var(--line));
}

.ops-admin-kpi-card--warning {
  border-color: color-mix(in oklab, #fbbf24 28%, var(--line));
}

.ops-admin-kpi-card--muted {
  border-color: var(--line);
}

.ops-admin-kpi-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.ops-admin-kpi-card__value {
  font-family: var(--font-head);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1;
  color: var(--fg-strong);
}

.ops-admin-kpi-card__meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.ops-admin-alert-list {
  display: grid;
  gap: 12px;
}

.ops-admin-alert-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 80%, transparent);
}

.ops-admin-alert-item--accent {
  border-color: color-mix(in oklab, var(--accent-to) 26%, var(--line));
}

.ops-admin-alert-item--warning {
  border-color: color-mix(in oklab, #fbbf24 32%, var(--line));
}

.ops-admin-alert-item--danger {
  border-color: color-mix(in oklab, #ef4444 34%, var(--line));
}

.ops-admin-alert-item--muted {
  border-color: var(--line);
}

.ops-admin-alert-item__icon .ops-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.ops-admin-alert-item__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ops-admin-alert-item__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.ops-admin-alert-item__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.ops-admin-alert-item__actions {
  display: flex;
  justify-content: flex-end;
}

.ops-admin-chart-card {
  position: relative;
  min-height: 280px;
}

.ops-admin-chart-card canvas {
  display: block;
  width: 100% !important;
  height: 280px !important;
}

.ops-admin-mini-list {
  display: grid;
  gap: 12px;
}

.ops-admin-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
}

.ops-admin-mini-row__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ops-admin-mini-row__meta {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.ops-admin-mini-row__handle {
  margin-left: 8px;
  font-size: 14px;
  color: var(--fg-muted);
}

.ops-admin-mini-row__stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.ops-admin-mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-0) 55%, transparent);
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.tour-runtime-view {
  max-width: 1360px;
  gap: 24px;
}

.board--dashboard {
  margin-top: 6px;
}

.board .row--active {
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--accent-from) 10%, transparent),
    color-mix(in oklab, var(--accent-to) 8%, transparent)
  );
}

.tour-runtime-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tour-runtime-head__main,
.tour-runtime-head__copy {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.tour-runtime-back {
  width: fit-content;
}

.tour-runtime-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--fg-muted);
  font-size: 13px;
}

.tour-runtime-head__meta span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--line) 88%, transparent);
  background: color-mix(in oklab, var(--bg-1) 74%, transparent);
}

.tour-runtime-head__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.tour-runtime-summary-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
}

.tour-runtime-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tour-runtime-sidebar {
  display: grid;
  gap: 16px;
  padding: 20px;
  position: sticky;
  top: calc(var(--header-h) + 18px);
  max-height: calc(100vh - var(--header-h) - 36px);
  overflow: hidden;
}

.tour-runtime-sidebar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tour-runtime-sidebar__list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.tour-runtime-task {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--line) 92%, transparent);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
  color: var(--fg);
  text-align: left;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.tour-runtime-task:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--accent-from) 46%, var(--line));
  box-shadow: 0 10px 24px rgba(6, 10, 20, 0.12);
}

.tour-runtime-task.is-active {
  border-color: color-mix(in oklab, var(--accent-to) 48%, var(--line));
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--accent-from) 11%, var(--bg-1)),
      color-mix(in oklab, var(--accent-to) 8%, var(--bg-1))
    ),
    color-mix(in oklab, var(--bg-1) 78%, transparent);
  box-shadow: 0 16px 34px rgba(244, 63, 94, 0.12);
}

.tour-runtime-task__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tour-runtime-task__index {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.tour-runtime-task__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.tour-runtime-task__meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.tour-runtime-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.tour-runtime-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(min(100%, 260px), 0.85fr);
  gap: 16px;
  align-items: start;
}

.tour-runtime-loading,
.tour-runtime-empty {
  display: grid;
  gap: 18px;
  align-items: start;
  padding: 28px;
}

.tour-runtime-loading__icon .ops-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

.tour-runtime-loading__title,
.tour-runtime-empty__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg-strong);
}

.tour-runtime-loading__desc,
.tour-runtime-empty__desc {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 60ch;
}

.tour-runtime-loading__actions,
.tour-runtime-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tour-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.tour-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tour-table th,
.tour-table td {
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.tour-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 60%, transparent);
}

.tour-table tbody tr + tr {
  border-top: 1px solid color-mix(in oklab, var(--line) 50%, transparent);
}

.tour-table__row--current {
  background: color-mix(in oklab, var(--accent-from) 8%, transparent);
}

.modal__panel--runtime {
  max-width: min(1240px, calc(100vw - 40px));
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.runtime-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.runtime-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.runtime-head__copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.runtime-head__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
}

.runtime-head__title {
  font-family: var(--font-head);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.05;
  color: var(--fg-strong);
}

.runtime-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--fg-muted);
  font-size: 13px;
}

.runtime-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.runtime-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.runtime-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
}

.runtime-summary-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.runtime-summary-card__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg-strong);
}

.runtime-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--accent-to) 30%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-to) 12%, transparent),
    color-mix(in oklab, #fbbf24 8%, transparent)
  );
}

.runtime-banner__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.runtime-banner__desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.runtime-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.runtime-sidebar {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 78%, transparent);
  max-height: calc(100vh - 240px);
  overflow: hidden;
}

.runtime-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runtime-sidebar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.runtime-sidebar__meta {
  color: var(--fg-muted);
  font-size: 13px;
}

.runtime-task-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.runtime-task-tile {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 82%, transparent);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.runtime-task-tile:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--accent-from) 40%, var(--line));
}

.runtime-task-tile.is-active {
  border-color: color-mix(in oklab, var(--accent-to) 40%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-from) 10%, var(--bg-1)),
    color-mix(in oklab, var(--accent-to) 8%, var(--bg-1))
  );
}

.runtime-task-tile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.runtime-task-tile__index {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.runtime-task-tile__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-strong);
}

.runtime-task-tile__meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.runtime-main {
  display: grid;
}

.runtime-task-panel {
  gap: 20px;
  padding: 22px;
}

.runtime-task-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.runtime-task-panel__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 700;
}

.runtime-task-panel__title {
  margin: 8px 0 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.08;
  color: var(--fg-strong);
}

.runtime-task-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--fg-muted);
  font-size: 13px;
}

.runtime-task-panel__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.runtime-statement {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 82%, transparent);
  color: var(--fg);
  line-height: 1.7;
  font-size: 15px;
}

.runtime-answer-card,
.runtime-side-card {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-1) 82%, transparent);
}

.runtime-answer-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.runtime-answer-card__title,
.runtime-side-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-strong);
}

.runtime-answer-card__meta {
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: 13px;
}

.runtime-answer-form {
  display: grid;
  gap: 16px;
}

.runtime-choices {
  display: grid;
  gap: 10px;
}

.runtime-choice {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-0) 60%, transparent);
  cursor: pointer;
}

.runtime-choice input {
  margin: 0;
}

.runtime-choice:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.72;
}

.runtime-choice__marker {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
}

.runtime-choice__label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
}

.runtime-text-answer {
  display: grid;
  gap: 10px;
}

.runtime-textarea {
  min-height: 136px;
  resize: vertical;
}

.runtime-answer-form .input:disabled,
.runtime-answer-form .textarea:disabled,
.runtime-answer-form button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.runtime-answer-hint {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
}

.runtime-answer-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.runtime-answer-form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.runtime-draft-state {
  color: var(--fg-muted);
  font-size: 13px;
}

.runtime-draft-state.is-success {
  color: var(--ok);
}

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

.runtime-history-empty {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.6;
}

.runtime-history-list,
.runtime-rules {
  display: grid;
  gap: 12px;
}

.runtime-history-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-0) 58%, transparent);
}

.runtime-history-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runtime-history-item__time,
.runtime-history-item__meta {
  font-size: 12px;
  color: var(--fg-muted);
}

.runtime-history-item__summary {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
}

.runtime-rules__item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-0) 58%, transparent);
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg);
}

.runtime-empty {
  padding: 12px 0 4px;
  color: var(--fg-muted);
  font-size: 15px;
}

@media (max-width: 1280px) {
  .ops-metric-grid--six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-admin-overview-grid,
  .ops-admin-overview-grid--secondary,
  .ops-admin-chart-grid {
    grid-template-columns: 1fr;
  }

  .ops-shell--editor,
  .ops-shell--composer,
  .ops-shell--aside,
  .ops-participants-layout {
    grid-template-columns: 1fr;
  }

  .ops-code-mode-grid,
  .ops-step-actions {
    grid-template-columns: 1fr;
  }

  .ops-sidebar {
    position: static;
    max-height: none;
  }

  .ops-sidebar__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .ops-sidebar.is-expanded .ops-sidebar__body {
    max-height: 60vh;
    overflow: auto;
  }

  .ops-sidebar__toggle {
    display: flex;
  }

  .runtime-layout,
  .runtime-bottom-grid,
  .tour-runtime-layout,
  .tour-runtime-main-grid {
    grid-template-columns: 1fr;
  }

  .runtime-sidebar,
  .tour-runtime-sidebar {
    max-height: none;
    position: static;
  }
}

@media (max-width: 960px) {
  .ops-metric-grid--three,
  .ops-metric-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-home-alert {
    grid-template-columns: auto 1fr;
  }

  .admin-home-alert .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .admin-home-charts {
    grid-template-columns: 1fr;
  }

  .ops-admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-admin-alert-item {
    grid-template-columns: auto 1fr;
  }

  .ops-admin-alert-item__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .ops-record-meta,
  .ops-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .runtime-summary-grid,
  .tour-runtime-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-form-grid--double > *,
  .ops-form-grid--triple > *,
  .ops-form-grid--quad > * {
    grid-column: span 6;
  }

  .ops-step-actions .ops-inline-actions:last-child {
    justify-content: flex-start;
  }

  .ops-admin-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ops-admin-row__controls {
    justify-content: flex-start;
  }

  .runtime-head,
  .runtime-task-panel__head,
  .runtime-answer-card__head,
  .tour-runtime-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .runtime-answer-form__foot {
    align-items: stretch;
  }

  .runtime-answer-form__actions,
  .runtime-head__actions,
  .runtime-task-panel__stats,
  .tour-runtime-head__actions {
    justify-content: stretch;
  }

  .runtime-answer-form__actions .btn,
  .runtime-head__actions .btn,
  .tour-runtime-head__actions .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .guest-session-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-header,
  .ops-record-head {
    flex-direction: column;
  }

  .admin-home-hero,
  .admin-home-feed-card--wide {
    grid-column: span 1;
  }

  .admin-home-hero__head,
  .notifications-toolbar,
  .notifications-item__head,
  .admin-home-user {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-home-hero__actions-row {
    grid-template-columns: 1fr;
  }

  .ops-header {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .ops-header__actions,
  .ops-record-head__actions,
  .ops-panel__actions {
    justify-content: flex-start;
  }

  .ops-metric-grid--three,
  .ops-metric-grid--four,
  .ops-metric-grid--six,
  .ops-record-meta {
    grid-template-columns: 1fr;
  }

  .ops-toggle-grid,
  .ops-code-mode-grid,
  .ops-step-actions {
    grid-template-columns: 1fr;
  }

  .ops-form-grid--double > *,
  .ops-form-grid--triple > *,
  .ops-form-grid--quad > * {
    grid-column: span 12;
  }

  .ops-form-submit-wrap {
    align-items: stretch;
  }

  .ops-form-submit-wrap .btn {
    width: 100%;
  }

  .ops-entity-row,
  .ops-panel__head {
    flex-direction: column;
    align-items: stretch;
  }

  .ops-admin-kpi-grid {
    grid-template-columns: 1fr;
  }

  .ops-admin-mini-row,
  .ops-admin-alert-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ops-admin-mini-row__stats,
  .ops-admin-alert-item__actions {
    justify-content: flex-start;
  }

  .admin-home-user__badges,
  .notifications-item__meta,
  .notifications-toolbar__actions {
    justify-content: flex-start;
  }

  .ops-entity-row__actions {
    justify-content: flex-start;
  }

  .ops-tabs {
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .ops-tab-count {
    min-width: 20px;
    height: 20px;
  }

  .runtime-summary-grid,
  .tour-runtime-summary {
    grid-template-columns: 1fr;
  }

  .runtime-shell {
    padding: 18px;
  }

  .tour-runtime-loading,
  .tour-runtime-empty {
    padding: 20px;
  }

  .runtime-task-tile__top,
  .runtime-history-item__top,
  .tour-runtime-task__top,
  .tour-runtime-sidebar__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================
   480px — Small phones
   ========================================= */
@media (max-width: 480px) {
  .ops-metric-card {
    padding: 16px;
    min-height: 120px;
    gap: 12px;
  }

  .ops-metric-card__value {
    font-size: clamp(24px, 7vw, 32px);
  }

  .ops-header {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .ops-header__title {
    font-size: clamp(20px, 5vw, 28px);
  }

  .ops-record-head__title {
    font-size: clamp(20px, 5vw, 26px);
  }

  .ops-record-head__actions {
    gap: 4px;
  }

  .ops-record-head__actions .btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  .ops-panel {
    padding: 16px;
  }

  .ops-sidebar {
    padding: 12px;
  }

  .ops-list-card {
    padding: 12px;
  }

  .adaptive-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-home-chart-wrap {
    height: 200px !important;
  }

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

  .ops-tabs {
    gap: 12px;
  }

  .tab-item {
    font-size: 13px;
    gap: 6px;
  }

  .workspace__content {
    padding: 12px;
  }
}

/* =========================================
   360px — Very small phones
   ========================================= */
@media (max-width: 360px) {
  .ops-metric-card {
    padding: 12px;
    min-height: 100px;
    gap: 10px;
  }

  .ops-metric-card__value {
    font-size: 22px;
  }

  .ops-metric-card__meta {
    font-size: 11px;
  }

  .ops-header {
    padding: 14px 10px;
    border-radius: 14px;
  }

  .ops-header__title {
    font-size: 18px;
  }

  .ops-record-head__title {
    font-size: 18px;
  }

  .ops-record-head__actions .btn {
    font-size: 11px;
    padding: 5px 8px;
  }

  .ops-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .tab-item {
    font-size: 12px;
    padding: 8px 4px;
    gap: 4px;
  }

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

  .ops-tab-count {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    padding: 0 5px;
  }

  .ops-entity-row {
    padding: 12px;
  }

  .workspace__content {
    padding: 8px;
  }

  .modal__panel {
    padding: 16px;
    border-radius: 16px;
  }
}

/* =========================================
   320px — Minimum supported width
   ========================================= */
@media (max-width: 320px) {
  .ops-metric-card {
    padding: 10px;
    min-height: 90px;
  }

  .ops-header {
    padding: 12px 8px;
  }

  .ops-header__subtitle,
  .ops-panel__desc {
    font-size: 12px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .btn--sm {
    padding: 5px 8px;
    font-size: 11px;
  }

  .ops-record-head__actions {
    gap: 3px;
  }

  .ops-record-head__actions .ops-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* =========================================
   Cross-browser compatibility fixes
   ========================================= */

/* Safari: explicit -webkit-backdrop-filter alongside standard */
@supports (-webkit-backdrop-filter: blur(10px)) and (not (backdrop-filter: blur(10px))) {
  .glass-panel,
  .header,
  .drawer__panel,
  .modal__backdrop {
    -webkit-backdrop-filter: var(--glass-blur);
  }
}

/* Firefox: ensure scrollbar-width is respected */
.ops-sidebar__body,
.ops-tabs,
.hscroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Safari/Firefox: flex gap fallback for older versions */
@supports not (gap: 1px) {
  .ops-record-head__actions > * + *,
  .ops-header__actions > * + * {
    margin-left: 6px;
  }
}

/* Firefox mobile: prevent hero content from causing horizontal shift.
   Only 'paint' — 'layout' breaks word sizing in Gecko on narrow viewports. */
.hero__stage {
  contain: paint;
}

/* Safari: fix background-clip for gradient text */
.word,
.tab-item.active,
.tab-item:hover {
  -webkit-background-clip: text;
  background-clip: text;
}

/* Edge/Safari: ensure smooth scroll behavior on all containers */
.ops-sidebar__body,
.tabs-nav,
.hscroll,
.notifications-body {
  -webkit-overflow-scrolling: touch;
}

/* Notch-safe padding for mobile devices */
@supports (padding-left: env(safe-area-inset-left)) {
  .workspace__content {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

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

/* ── Support Chats Panel ── */
.support-chats-view { position: relative; }
.sc-filters { display: flex; gap: 8px; margin-bottom: 16px; }
.sc-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  min-height: 480px;
  max-height: 72vh;
}
.sc-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 72vh;
}
.sc-chat-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.sc-chat-item:hover { background: color-mix(in oklab, var(--bg-3) 50%, transparent); }
.sc-chat-item--active { background: color-mix(in oklab, var(--accent) 12%, transparent); }
.sc-chat-item__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.sc-chat-item__name { font-weight: 600; font-size: 13px; color: var(--fg-strong); }
.sc-chat-item__time { font-size: 11px; color: var(--fg-muted); }
.sc-chat-item__preview { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-chat-item__count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg);
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 5px; margin-left: 6px;
}
.sc-status--open { color: #4caf50; }
.sc-status--closed { color: #999; }
.sc-main { display: flex; flex-direction: column; max-height: 72vh; }
.sc-chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.sc-chat-header__meta { font-size: 12px; color: var(--fg-muted); flex: 1; }
.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sc-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.sc-msg--visitor { align-self: flex-start; background: color-mix(in oklab, var(--bg-3) 80%, transparent); color: var(--fg); border-bottom-left-radius: 4px; }
.sc-msg--staff { align-self: flex-end; background: var(--accent); color: var(--bg); border-bottom-right-radius: 4px; }
.sc-msg__name { font-size: 11px; opacity: 0.7; margin-bottom: 2px; }
.sc-msg__time { font-size: 10px; opacity: 0.5; }
.sc-msg__body { white-space: pre-wrap; }
.sc-input-bar {
  display: flex; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-2) 60%, transparent);
}
.sc-input-bar--closed { justify-content: center; color: var(--fg-muted); font-size: 13px; }
.sc-reply-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--fg); font-size: 13px; outline: none;
}
.sc-reply-input:focus { border-color: var(--accent); }
.sc-empty { padding: 40px; text-align: center; color: var(--fg-muted); font-size: 14px; flex: 1; display: flex; align-items: center; justify-content: center; }

@media (max-width: 768px) {
  .sc-layout { grid-template-columns: 1fr; min-height: auto; max-height: none; }
  .sc-sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .sc-main { min-height: 300px; max-height: 60vh; }
}

/* ─── Rating Explain Modal ─── */
.rating-explain-section { display: grid; gap: 12px; }
.rating-explain-current { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rating-explain-heading { font-size: 15px; font-weight: 600; color: var(--fg-strong); margin: 0; }
.rating-explain-text { font-size: 13px; color: var(--fg-muted); margin: 0; line-height: 1.5; }
.rating-explain-details { display: grid; gap: 8px; }
.rating-explain-detail { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--muted); border-radius: 8px; font-size: 13px; }
.rating-explain-detail-label { color: var(--fg-muted); }
.rating-explain-detail-value { color: var(--fg-strong); font-family: var(--font-mono, monospace); font-size: 12px; }

/* ─── Rating Ranks List ─── */
.rating-ranks-list { display: grid; gap: 4px; }
.rating-rank-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--muted); border-radius: 8px; font-size: 13px; }
.rating-rank-row--active { background: var(--muted-2); border: 1px solid var(--border-2); }
.rating-rank-title { color: var(--fg-strong); font-weight: 500; }
.rating-rank-threshold { color: var(--fg-muted); font-family: var(--font-mono, monospace); font-size: 12px; }

/* ─── Rating History ─── */
.rating-history-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--muted); border-radius: 10px; gap: 12px; }
.rating-history-row__left { display: grid; gap: 2px; min-width: 0; flex: 1; }
.rating-history-row__right { display: grid; gap: 2px; text-align: right; flex-shrink: 0; }
.rating-history-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-muted); }
.rating-history-desc { font-size: 13px; color: var(--fg-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating-history-date { font-size: 11px; color: var(--fg-muted); }
.rating-delta { font-size: 14px; font-weight: 600; font-family: var(--font-mono, monospace); }
.rating-delta--positive { color: var(--green); }
.rating-delta--negative { color: var(--danger); }
.rating-delta--neutral { color: var(--fg-muted); }
.rating-value { font-size: 12px; color: var(--fg-muted); }

@media (max-width: 480px) {
  .rating-explain-current { grid-template-columns: 1fr; }
  .rating-history-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .rating-history-row__right { flex-direction: row; display: flex; gap: 12px; text-align: left; }
}
