/* header.css — общие стили для <header> и навигации */

/* Отключаем выделение и тач‐меню в шапке сайта */
header {
  -webkit-touch-callout: none;   /* отключить меню при долгом таче */
  -webkit-user-select: none;     /* Safari */
  -khtml-user-select: none;      /* Konqueror */
  -moz-user-select: none;        /* Firefox */
  -ms-user-select: none;         /* Internet Explorer/Edge */
  user-select: none;             /* стандарт */
  touch-action: manipulation;    /* запретить двойной тап-зум/скролл */
}

/* Централизованные стили ссылок (как вкладки) */
a {
  display: inline-block;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 10px;
  color: #1A1A1A;
  background: transparent;
  transition: background-color 0.34s cubic-bezier(0.22, 1, 0.36, 1), color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover {
  background-color: #1A1A1A;
  color: #F1F1F1;
}

/* Переопределение для карточек ресурсов и Telegram */
a.resource-card,
a.tg-card {
  transition: background-color 0.6s ease, color 0.6s ease, transform 0.6s ease, box-shadow 0.6s ease;
}

a.resource-card:hover,
a.tg-card:hover {
  transition-delay: 0s;
}

html[data-theme="dark"] a {
  color: #F1F1F1;
}

html[data-theme="dark"] a:hover {
  background-color: #F1F1F1;
  color: #1A1A1A;
}


/* Ховер вкладок в хеддере с корректной инверсией темы */
.site-header nav a:hover {
  background-color: #1A1A1A;
  color: #F1F1F1;
}
html[data-theme="dark"] .site-header nav a:hover {
  background-color: #F1F1F1;
  color: #1A1A1A;
}

@media (hover: none) and (pointer: coarse) {
  a:hover,
  html[data-theme="dark"] a:hover,
  .site-header nav a:hover,
  html[data-theme="dark"] .site-header nav a:hover {
    background-color: transparent;
    color: inherit;
  }
}
header a, header .header-container, header .site-title {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

header {
  position: relative;
  padding: 0;
}

/* Централизованная фиксированная шапка */
:root {
  --site-header-height: 90px;
  --header-desktop-scale: 1;
  --header-glass-bg: rgba(255, 255, 255, 0.22);
  --header-glass-border: 1px solid rgba(0, 0, 0, 0.05);
  --header-glass-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  --header-glass-blur: 3px;
  --header-glass-saturate: 90%;
}

@media (min-width: 601px) {
  :root {
    --site-header-height: 99px;
    --header-desktop-scale: 1.1;
  }
}

html[data-theme="light"] {
  color-scheme: light;
  background-color: #ffffff;
  color: #1a1a1a;
}

html[data-theme="dark"] {
  color-scheme: dark;
  background-color: #1a1a1a;
  color: #f1f1f1;
}

html[data-theme="light"] body {
  background-color: #ffffff;
  color: #1a1a1a;
}

html[data-theme="dark"] body {
  background-color: #1a1a1a;
  color: #f1f1f1;
}

html[data-theme="light"],
html[data-theme="dark"],
html[data-theme="light"] body,
html[data-theme="dark"] body {
  transition:
    background-color 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --header-glass-bg: rgba(18, 18, 18, 0.2);
  --header-glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --header-glass-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --header-glass-bg: rgba(18, 18, 18, 0.2);
    --header-glass-border: 1px solid rgba(255, 255, 255, 0.12);
    --header-glass-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  }
}

@media (max-width: 600px) {
  :root {
    --site-header-height: 150px;
  }
}

body {
  padding-top: var(--site-header-height) !important;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "home nav theme";
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease, transform 0.25s ease;
  transform: translateY(6px);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 8px;
  border-radius: 16px;
  background: var(--header-glass-bg);
  border: var(--header-glass-border);
  box-shadow: var(--header-glass-shadow);
  backdrop-filter: blur(var(--header-glass-blur)) saturate(var(--header-glass-saturate));
  -webkit-backdrop-filter: blur(var(--header-glass-blur)) saturate(var(--header-glass-saturate));
  opacity: 0;
  transition:
    opacity 0.25s ease,
    background 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.site-header > * {
  position: relative;
  z-index: 1;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

.site-header.is-scrolled {
  transform: translateY(6px);
  transition: transform 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}


.header-container {
  position: static;
  display: flex;
  align-items: center;
  gap: calc(8px * var(--header-desktop-scale));
  margin: 0;
}

.logo img {
  padding: 0;
  width: calc(32px * var(--header-desktop-scale));
  height: calc(32px * var(--header-desktop-scale));
  margin-right: calc(5px * var(--header-desktop-scale));
  opacity: 0;
  transform: translateZ(0) scale(1) rotate(0deg);
  transform-origin: 50% 50%;
  transition:
    transform 0.48s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.48s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
  backface-visibility: hidden;
}

.logo img.logo-ready {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .logo img {
    will-change: transform, filter;
  }

  .logo:hover img,
  .logo:focus-within img {
    transition-delay: 70ms;
    transform: translateZ(0) scale(1.045) rotate(-5deg);
    filter: saturate(1.03);
  }

  .logo:not(:hover):not(:focus-within) img {
    transition-delay: 0s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo img {
    transition: none;
  }
}

header.welcome {
  border-radius: 0;
  padding: calc(2px * var(--header-desktop-scale)) calc(4px * var(--header-desktop-scale));
  margin: 0;
  color: #44BBC1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: calc(8px * var(--header-desktop-scale));
  align-self: center;
  grid-area: home;
}

@media (max-width: 600px) {
  header.welcome {
    padding: 2px 4px;
  }
}

.site-title { /*темная тема осталась в styles.css questions.css */
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size: calc(10px * var(--header-desktop-scale));
  color: #1e1e1e;
  opacity: 0.7;
  margin-left: calc(4px * var(--header-desktop-scale));
  cursor: pointer;
  border-radius: 8px;
  transition:
    color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-title:focus {
  outline: none;
}

.site-title:focus-visible {
  outline: 2px solid rgba(255, 160, 1, 0.35);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .site-title:hover,
  .site-title:focus-visible {
    color: #FFA001;
    opacity: 1;
    background-color: transparent;
  }
}

html[data-theme="dark"] .site-title {
  color: #f1f1f1;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="dark"] .site-title:hover,
  html[data-theme="dark"] .site-title:focus-visible {
    color: #FFA001;
    opacity: 1;
  }
}
@media (max-width: 1200px) {
  .site-title {
    display: none;
  }
}

.site-header nav {
  position: relative;
  padding: 8px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-align: center;
  align-items: center;
  justify-content: center;
  font-size: calc(12px * var(--header-desktop-scale));
  grid-area: nav;
  transition:
    border-color 0.28s ease,
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header nav::before,
.theme-switcher .trainer-welcome-help-btn::before,
.theme-switcher .auth-open-btn::before,
.theme-switcher #theme-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: var(--header-glass-border, 1px solid rgba(0, 0, 0, 0.05));
  background: var(--header-glass-bg, rgba(255, 255, 255, 0.22));
  box-shadow: var(--header-glass-shadow);
  backdrop-filter: blur(var(--header-glass-blur)) saturate(var(--header-glass-saturate));
  -webkit-backdrop-filter: blur(var(--header-glass-blur)) saturate(var(--header-glass-saturate));
  opacity: 0;
  transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.site-header nav > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 600px) {
  .site-header nav {
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    margin: 0 auto;     /* выравниваем по центру */
  }
}

@media (min-width: 600px) and (max-width: 900px) {
  .site-header nav {
    max-width: 500px;   /* общий контейнер уже */
    margin: 0 auto;     /* выравниваем по центру */
  }
}

.site-header nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0; /* компактнее под липкий хедер */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 12px;
}

.site-header nav li {
  margin-right: calc(6px * var(--header-desktop-scale));
}

.site-header nav a {
  text-decoration: none;
  padding: calc(6px * var(--header-desktop-scale)) calc(12px * var(--header-desktop-scale));
  color: #1A1A1A;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size: calc(12px * var(--header-desktop-scale));
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.2;
  transition:
    color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .site-header nav a {
  color: #F1F1F1;
}

.site-header nav a.answer-link {
  background-color: #8CD136; /* есть в questions.css, отсутствует в styles.css */
  color: #F1F1F1;            /* есть в questions.css, отсутствует в styles.css */
}

/* отступ между соседними кнопками (оставляем как есть) */
.answer-links .answer-link + .answer-link {
  margin-left: 0.5em;
  background-color: #64B8FF;
}

.site-header nav a.answer-link.author-link {
  display: inline-flex;
  align-items: center;
  width: auto;
  padding: calc(4.5px * var(--header-desktop-scale)) calc(8px * var(--header-desktop-scale));
}

/* картинка-аватар внутри кнопки слева от текста */
.site-header nav a.answer-link.author-link img {
  width: calc(24px * var(--header-desktop-scale));
  height: calc(24px * var(--header-desktop-scale));
  margin-left: calc(8px * var(--header-desktop-scale));      /* теперь отступ справа, между аватаром и текстом */
  object-fit: cover;
  border-radius: 50%;
}

.answer-links .answer-link.author-link:hover {
  background-color: #1A1A1A;
  color: #F1F1F1;
}

html[data-theme="dark"] .answer-links .answer-link.author-link:hover {
        background-color: #F1F1F1;
        color: #1A1A1A;
  }

b {
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 10px;
  background-color: #58BEFE;
  color: #FFFFFF;
  transition:
    background-color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

b:hover {
  background-color: rgba(255, 255, 255, 1);
  color: #1A1A1A;
}


/* Переключатель темы (единые стили) */
.theme-switcher {
  position: static;
  margin-left: 0;
  z-index: 1;
  margin-right: calc(4px * var(--header-desktop-scale));
  align-self: center;
  grid-area: theme;
  display: inline-flex;
  align-items: center;
  gap: calc(4px * var(--header-desktop-scale));
}

header.welcome { justify-self: start; }
.site-header nav { justify-self: center; }
.theme-switcher { justify-self: end; }

/* Узкие экраны: домашняя иконка слева снизу, тема справа снизу */
@media (max-width: 600px) {
  .site-header {
    position: fixed;
    padding: 6px 10px 2px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "nav nav"
      "home theme";
    row-gap: 4px;
    column-gap: 4px;
    align-items: center;
  }
  .site-header {
    transform: translateY(6px);
  }
  .site-header nav {
    grid-area: nav;
    width: 100%;
  }
  header.welcome {
    grid-area: home;
    position: static;
    padding: 0;
    justify-content: flex-start;
    justify-self: start;
  }
  .theme-switcher {
    grid-area: theme;
    position: static;
    justify-self: end;
  }

  .site-header.is-scrolled {
    border-radius: 14px;
  }
}

/* Минимальные отступы навигации от краёв всегда */
.site-header nav ul {
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 600px) {
  .site-header nav ul {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 600px) {
  header.welcome {
    padding-left: 6px;
    padding-right: 6px;
    padding-top: 0;
    margin-top: -2px;
  }
  .theme-switcher {
    padding-left: 6px;
    padding-right: 6px;
    padding-top: 0;
    margin-top: -2px;
  }
}

/* Широкие экраны: раздельные подложки (вкладки отдельно, дом+тема отдельно) */
@media (min-width: 600px) {
  .site-header::before {
    display: none !important;
    opacity: 0 !important;
    content: none;
  }
  .site-header.is-scrolled nav::before {
    opacity: 1;
  }
  .site-header.is-scrolled header.welcome,
  .site-header.is-scrolled .theme-switcher {
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header.is-scrolled header.welcome {
    /* Keep the same box metrics as the default state to avoid logo jitter. */
    padding: calc(2px * var(--header-desktop-scale)) calc(4px * var(--header-desktop-scale));
  }
}

.theme-switcher button {
  color: #1A1A1A;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin: 0;
  padding: calc(4px * var(--header-desktop-scale));
  box-shadow: none;
  outline: none;
  transition: color 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease;
}

.theme-switcher button.active {
  color: #F1F1F1;
}

.theme-switcher button:focus,
.theme-switcher button:focus-visible,
.theme-switcher button:active {
  background: transparent;
  box-shadow: none;
  outline: none;
}

.theme-switcher button:hover {
  background: transparent;
  color: #FFA001;
}

.toggleButton_gllP {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
  background: none;
  border: none;
  width: auto;
  min-width: calc(2rem * var(--header-desktop-scale));
  height: calc(2rem * var(--header-desktop-scale));
  cursor: pointer;
  transition: background 0.2s;
}
.toggleButton_gllP:hover {
  background: transparent;
}

.theme-switcher .auth-open-btn {
  position: relative;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 50%;
  width: calc(2rem * var(--header-desktop-scale));
  min-width: calc(2rem * var(--header-desktop-scale));
  height: calc(2rem * var(--header-desktop-scale));
  padding: 0;
  font-size: calc(12px * var(--header-desktop-scale));
  font-weight: 600;
  line-height: 1;
  margin-right: calc(4px * var(--header-desktop-scale));
  color: #1A1A1A;
  transition:
    color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    min-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    gap 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switcher .trainer-welcome-help-btn {
  position: relative;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 50%;
  width: calc(2rem * var(--header-desktop-scale));
  min-width: calc(2rem * var(--header-desktop-scale));
  height: calc(2rem * var(--header-desktop-scale));
  padding: 0;
  margin-right: calc(4px * var(--header-desktop-scale));
  color: #1A1A1A;
  font-size: calc(15px * var(--header-desktop-scale));
  font-weight: 800;
  line-height: 1;
  transition: color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switcher .auth-open-btn.is-guest {
  gap: calc(6px * var(--header-desktop-scale));
  width: auto;
  min-width: calc(2rem * var(--header-desktop-scale));
  padding: 0 calc(10px * var(--header-desktop-scale));
  border-radius: 999px;
}

html[data-auth-visual-state="guest"] .theme-switcher .auth-open-btn:not(.is-auth) {
  gap: calc(6px * var(--header-desktop-scale));
  width: auto;
  min-width: calc(2rem * var(--header-desktop-scale));
  padding: 0 calc(10px * var(--header-desktop-scale));
  border-radius: 999px;
}

.theme-switcher #theme-toggle {
  position: relative;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 999px;
  padding: 0;
  transition:
    color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switcher .trainer-welcome-help-btn > *,
.theme-switcher .auth-open-btn > *,
.theme-switcher #theme-toggle > * {
  position: relative;
  z-index: 1;
}

@media (min-width: 601px) {
  .site-header.is-scrolled .theme-switcher .trainer-welcome-help-btn::before,
  .site-header.is-scrolled .theme-switcher .auth-open-btn::before,
  .site-header.is-scrolled .theme-switcher #theme-toggle::before {
    opacity: 1;
  }
}

.theme-switcher .auth-open-btn svg {
  width: calc(20px * var(--header-desktop-scale));
  height: calc(20px * var(--header-desktop-scale));
}

.theme-switcher .trainer-welcome-help-btn__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.theme-switcher .auth-open-btn__icon,
.theme-switcher .auth-open-btn__label {
  position: relative;
  z-index: 1;
}

.theme-switcher .auth-open-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.theme-switcher .auth-open-btn__label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: inherit;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switcher .auth-open-btn.is-guest .auth-open-btn__label {
  max-width: 64px;
  opacity: 1;
  transform: translateX(0);
}

html[data-auth-visual-state="guest"] .theme-switcher .auth-open-btn:not(.is-auth) .auth-open-btn__label {
  max-width: 64px;
  opacity: 1;
  transform: translateX(0);
}

.theme-switcher .toggleButton_gllP:not(.auth-open-btn) svg {
  width: calc(24px * var(--header-desktop-scale));
  height: calc(24px * var(--header-desktop-scale));
}

.theme-switcher .auth-open-btn:hover {
  background: transparent;
  color: #FFA001;
}

.theme-switcher .trainer-welcome-help-btn:hover {
  background: transparent;
  color: #FFA001;
}

html[data-theme="dark"] .theme-switcher .trainer-welcome-help-btn {
  color: #F1F1F1;
}

html[data-theme="dark"] .theme-switcher .trainer-welcome-help-btn:hover {
  background: transparent;
  color: #FFA001;
}

html[data-theme="dark"] .theme-switcher .auth-open-btn {
  color: #F1F1F1;
}

html[data-theme="dark"] .theme-switcher .auth-open-btn:hover {
  background: transparent;
  color: #FFA001;
}

html[data-theme="dark"] .theme-switcher #theme-toggle {
  color: #F1F1F1;
}

html[data-theme="dark"] .theme-switcher #theme-toggle:hover {
  color: #FFA001;
}

@keyframes authSyncSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1250;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease, background 180ms ease;
}

.auth-modal.show {
  opacity: 1;
  visibility: visible;
}

.auth-modal[data-placement="centered"].show {
  pointer-events: auto;
}

.auth-modal.auth-checking .auth-level-wrap,
.auth-modal.auth-checking .auth-oauth-row,
.auth-modal.auth-checking .auth-email-toggle,
.auth-modal.auth-checking .auth-email-input,
.auth-modal.auth-checking .auth-actions {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-4px);
}

.auth-modal.auth-checking #auth-description {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  transform: translateY(-4px);
}

.auth-card {
  position: absolute;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(412px, 96vw);
  border: var(--header-glass-border, 1px solid rgba(0, 0, 0, 0.05));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(var(--header-glass-blur, 3px)) saturate(var(--header-glass-saturate, 90%));
  -webkit-backdrop-filter: blur(var(--header-glass-blur, 3px)) saturate(var(--header-glass-saturate, 90%));
  box-shadow: var(--header-glass-shadow, 0 10px 24px rgba(0, 0, 0, 0.12));
  border-radius: 14px;
  padding: 0.88rem 0.92rem;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  transition: width 220ms ease, height 220ms ease, padding 220ms ease, opacity 180ms ease, transform 180ms ease;
}

.auth-modal[data-placement="centered"] {
  background: rgba(15, 23, 42, 0.16);
}

.auth-modal[data-placement="anchored"] {
  background: transparent;
}

.auth-modal[data-placement="anchored"] .auth-card {
  transform: none;
  transform-origin: top right;
  opacity: 0;
  transition: width 220ms ease, height 220ms ease, padding 220ms ease, opacity 180ms ease, transform 180ms ease;
}

.auth-modal[data-placement="centered"] .auth-card {
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

.auth-modal.show .auth-card {
  opacity: 1;
}

.auth-modal[data-placement="anchored"]:not(.show) .auth-card {
  transform: translateY(-6px);
}

.auth-modal[data-placement="centered"]:not(.show) .auth-card {
  transform: translate(-50%, calc(-50% + 8px));
}

.auth-card.is-morphing {
  overflow: clip;
}

.auth-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
}

.auth-text {
  margin: 0.35rem 0;
  font-size: 0.94rem;
}

#auth-description {
  max-height: 60px;
  overflow: hidden;
}

#auth-description,
.auth-identity,
.auth-level-wrap,
.auth-oauth-row,
.auth-email-toggle,
.auth-email-input,
.auth-actions {
  transition: opacity 180ms ease, max-height 220ms ease, margin-top 220ms ease, transform 180ms ease, padding 220ms ease;
}

.auth-status {
  min-height: 1.1rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-identity {
  display: none;
  flex-direction: column;
  gap: 0.36rem;
  margin-top: 0.46rem;
  min-width: 0;
}

.auth-identity.is-visible {
  display: flex;
}

.auth-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.34rem;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  gap: 0.34rem;
  min-height: 30px;
  padding: 0.32rem 0.58rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.auth-chip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: inherit;
}

.auth-chip__label {
  min-width: 0;
  white-space: nowrap;
}

.auth-chip--provider {
  background: rgba(0, 0, 0, 0.08);
}

.auth-chip--track-qa {
  background: rgba(47, 163, 153, 0.16);
  color: #136a63;
}

.auth-chip--track-aqa {
  background: rgba(56, 103, 214, 0.16);
  color: #234eb5;
}

.auth-chip--track-fullstack {
  background: rgba(119, 76, 211, 0.15);
  color: #6841ba;
}

.auth-chip--track-default {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.auth-chip--grade-trainee {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.auth-chip--grade-junior {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.auth-chip--grade-middle {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.auth-chip--grade-senior {
  background: rgba(139, 92, 246, 0.18);
  color: #6d28d9;
}

.auth-chip--grade-lead {
  background: rgba(244, 63, 94, 0.16);
  color: #be123c;
}

.auth-chip--grade-default {
  background: rgba(71, 85, 105, 0.14);
  color: #334155;
}

.auth-user-email {
  margin: 0;
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(20, 20, 20, 0.72);
  overflow-wrap: anywhere;
  cursor: default;
  user-select: text;
  -webkit-tap-highlight-color: transparent;
}

.auth-level-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.38rem;
  margin-top: 0.42rem;
  max-height: 96px;
  overflow: hidden;
}

.auth-oauth-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.38rem;
  margin-top: 0.42rem;
  max-height: 64px;
  overflow: hidden;
}

.auth-oauth-btn {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 10px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  padding: 0.48rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.auth-oauth-btn span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-oauth-btn:hover {
  background: #f8f9fa;
  border-color: #d2d5da;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.auth-oauth-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  border: none;
  font-size: 0;
  line-height: 1;
}

.auth-email-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0.34rem;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(20, 20, 20, 0.6);
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(20, 20, 20, 0.2);
  text-underline-offset: 2px;
  max-height: 28px;
  overflow: hidden;
}

.auth-email-toggle:hover {
  color: rgba(20, 20, 20, 0.82);
  text-decoration-color: rgba(20, 20, 20, 0.35);
}

.auth-select {
  width: 100%;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  background-color: rgba(100, 116, 139, 0.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  color: inherit;
  padding: 0.32rem 2.2rem 0.32rem 0.62rem;
  font-size: 0.82rem;
  font-weight: 600;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  touch-action: manipulation;
}

.auth-select:focus {
  outline: none;
  border-color: rgba(15, 23, 42, 0.16);
}

.auth-select--track-qa {
  background-color: rgba(47, 163, 153, 0.16);
  color: #136a63;
}

.auth-select--track-aqa {
  background-color: rgba(56, 103, 214, 0.16);
  color: #234eb5;
}

.auth-select--track-fullstack {
  background-color: rgba(119, 76, 211, 0.15);
  color: #6841ba;
}

.auth-select--track-default {
  background-color: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.auth-select--grade-trainee {
  background-color: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.auth-select--grade-junior {
  background-color: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.auth-select--grade-middle {
  background-color: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.auth-select--grade-senior {
  background-color: rgba(139, 92, 246, 0.18);
  color: #6d28d9;
}

.auth-select--grade-lead {
  background-color: rgba(244, 63, 94, 0.16);
  color: #be123c;
}

.auth-select--grade-default {
  background-color: rgba(71, 85, 105, 0.14);
  color: #334155;
}

.auth-email-input {
  width: 100%;
  margin-top: 0.46rem;
  padding: 0.56rem 0.62rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  max-height: 60px;
  overflow: hidden;
}

.auth-email-input::placeholder {
  font-size: 0.9rem;
}

.auth-email-error {
  display: none;
  margin: 0.3rem 0 0;
  color: rgba(220, 38, 38, 0.9);
  font-size: 0.74rem;
  line-height: 1.3;
}

.auth-email-error.is-visible {
  display: block;
}

.auth-email-input.is-invalid {
  border-color: rgba(220, 38, 38, 0.72);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.14);
}

.auth-email-input.is-invalid:focus {
  border-color: rgba(220, 38, 38, 0.82);
}

.auth-legal-note {
  margin: 0.5rem 0 0;
  font-size: 0.66rem;
  line-height: 1.45;
  color: rgba(20, 20, 20, 0.62);
}

.auth-legal-note a {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal-note a:hover {
  background: transparent;
  color: rgba(20, 20, 20, 0.9);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.42rem;
  margin-top: 0.58rem;
  max-height: 48px;
  overflow: hidden;
}

.auth-send-btn,
.auth-close-btn {
  border: none;
  border-radius: 10px;
  padding: 0.42rem 0.72rem;
  cursor: pointer;
  font-size: 0.8rem;
  touch-action: manipulation;
}

.auth-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 16px;
  line-height: 1;
  touch-action: manipulation;
}

.auth-sync-btn:hover {
  background: rgba(0, 0, 0, 0.14);
}

.auth-send-btn:disabled,
.auth-close-btn:disabled,
.auth-sync-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-send-btn:disabled:hover,
.auth-close-btn:disabled:hover,
.auth-sync-btn:disabled:hover {
  box-shadow: none;
}

.auth-sync-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.auth-sync-btn.is-busy {
  pointer-events: none;
  opacity: 0.9;
}

.auth-sync-btn.is-busy .auth-sync-icon {
  animation: authSyncSpin 0.95s linear infinite;
}

.auth-sync-btn.is-success {
  background: rgba(145, 222, 170, 0.45);
  box-shadow: 0 0 0 1px rgba(115, 190, 140, 0.35) inset;
}

.auth-send-btn {
  background: #ffb347;
  color: #2a1a05;
}

.auth-close-btn {
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.auth-modal.compact-auth .auth-card {
  width: min(252px, 70vw);
  padding: 0.46rem 0.48rem;
}

.auth-modal.compact-auth .auth-card h3 {
  font-size: 0.82rem;
  margin-bottom: 0.12rem;
  text-align: center;
}

.auth-modal.compact-auth .auth-text {
  font-size: 0.72rem;
  margin: 0.12rem 0;
}

.auth-modal.compact-auth .auth-identity {
  margin-top: 0.18rem;
  gap: 0.22rem;
  align-items: center;
}

.auth-modal.compact-auth .auth-chip-row {
  justify-content: center;
}

.auth-modal.compact-auth .auth-chip {
  min-height: 24px;
  padding: 0.26rem 0.44rem;
  font-size: 0.64rem;
}

.auth-modal.compact-auth .auth-user-email {
  font-size: 0.64rem;
  text-align: center;
}

.auth-modal.compact-auth .auth-level-wrap,
.auth-modal.compact-auth .auth-oauth-row,
.auth-modal.compact-auth .auth-email-error,
.auth-modal.compact-auth #auth-description,
.auth-modal.compact-auth .auth-legal-note {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-4px);
}

.auth-modal.compact-auth .auth-status {
  min-height: 0;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-modal.compact-auth .auth-actions {
  justify-content: center;
  margin-top: 0.18rem;
  gap: 0.22rem;
}

.auth-modal.compact-auth .auth-send-btn,
.auth-modal.compact-auth .auth-close-btn {
  padding: 0.26rem 0.42rem;
  font-size: 0.62rem;
}

.auth-modal.compact-auth .auth-sync-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  font-size: 10px;
}

.auth-modal.compact-auth .auth-send-btn {
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.auth-modal.compact-auth .auth-close-btn {
  background: #ffb347;
  color: #2a1a05;
}

.auth-modal.compact-auth .auth-sync-btn,
.auth-modal.compact-auth .auth-send-btn {
  transition: opacity 180ms ease, visibility 180ms ease;
}

.auth-modal.compact-auth.auth-profile-pending .auth-sync-btn,
.auth-modal.compact-auth.auth-profile-pending .auth-send-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html[data-theme="dark"] .auth-email-input {
  background: rgba(22, 27, 35, 0.62);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f3f6ff;
}

html[data-theme="dark"] .auth-email-input.is-invalid {
  border-color: rgba(248, 113, 113, 0.82);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.16);
}

html[data-theme="dark"] .auth-email-error {
  color: rgba(252, 165, 165, 0.96);
}

html[data-theme="dark"] .auth-card {
  background: rgba(22, 27, 35, 0.94);
}

html[data-theme="dark"] .auth-modal[data-placement="centered"] {
  background: rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .auth-select {
  border-color: transparent;
  color: #f3f6ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%23dce7ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-theme="dark"] .auth-select:focus {
  border-color: rgba(220, 231, 255, 0.2);
}

html[data-theme="dark"] .auth-select--track-qa {
  background-color: rgba(45, 212, 191, 0.18);
  color: #9ff3e7;
}

html[data-theme="dark"] .auth-select--track-aqa {
  background-color: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

html[data-theme="dark"] .auth-select--track-fullstack {
  background-color: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
}

html[data-theme="dark"] .auth-select--track-default {
  background-color: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-select--grade-trainee {
  background-color: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

html[data-theme="dark"] .auth-select--grade-junior {
  background-color: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

html[data-theme="dark"] .auth-select--grade-middle {
  background-color: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

html[data-theme="dark"] .auth-select--grade-senior {
  background-color: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}

html[data-theme="dark"] .auth-select--grade-lead {
  background-color: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
}

html[data-theme="dark"] .auth-select--grade-default {
  background-color: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-oauth-btn {
  background: rgba(28, 35, 46, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef4ff;
}

html[data-theme="dark"] .auth-oauth-btn:hover {
  background: rgba(38, 47, 60, 0.96);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .auth-oauth-icon {
  border-color: transparent;
}

html[data-theme="dark"] .auth-email-toggle {
  color: rgba(220, 231, 255, 0.6);
  text-decoration-color: rgba(220, 231, 255, 0.2);
}

html[data-theme="dark"] .auth-email-toggle:hover {
  color: rgba(220, 231, 255, 0.82);
  text-decoration-color: rgba(220, 231, 255, 0.35);
}

html[data-theme="dark"] .auth-legal-note {
  color: rgba(220, 231, 255, 0.66);
}

html[data-theme="dark"] .auth-chip {
  background: rgba(255, 255, 255, 0.1);
  color: #f3f6ff;
}

html[data-theme="dark"] .auth-chip--track-qa {
  background: rgba(45, 212, 191, 0.18);
  color: #9ff3e7;
}

html[data-theme="dark"] .auth-chip--track-aqa {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

html[data-theme="dark"] .auth-chip--track-fullstack {
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
}

html[data-theme="dark"] .auth-chip--track-default {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-chip--grade-trainee {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

html[data-theme="dark"] .auth-chip--grade-junior {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

html[data-theme="dark"] .auth-chip--grade-middle {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

html[data-theme="dark"] .auth-chip--grade-senior {
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}

html[data-theme="dark"] .auth-chip--grade-lead {
  background: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
}

html[data-theme="dark"] .auth-chip--grade-default {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-user-email {
  color: rgba(220, 231, 255, 0.76);
}

html[data-theme="dark"] .auth-legal-note a:hover {
  background: transparent;
  color: rgba(220, 231, 255, 0.95);
  text-decoration-color: rgba(220, 231, 255, 0.34);
}

html[data-theme="dark"] .auth-close-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #dce7ff;
}

html[data-theme="dark"] .auth-modal.compact-auth .auth-send-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #dce7ff;
}

html[data-theme="dark"] .auth-modal.compact-auth .auth-send-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .auth-modal.compact-auth .auth-close-btn {
  background: #ffb347;
  color: #2a1a05;
}

html[data-theme="dark"] .auth-sync-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #dce7ff;
}

html[data-theme="dark"] .auth-sync-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .auth-sync-btn.is-success {
  background: rgba(123, 194, 146, 0.28);
  box-shadow: 0 0 0 1px rgba(123, 194, 146, 0.35) inset;
}

@media (max-width: 600px) {
  .theme-switcher #theme-toggle {
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border-radius: 50%;
    opacity: 1;
  }

  .theme-switcher .trainer-welcome-help-btn,
  .theme-switcher .auth-open-btn {
    width: 1.9rem;
    min-width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    margin-right: 2px;
  }
  .theme-switcher .auth-open-btn svg {
    width: 18px;
    height: 18px;
  }
  .theme-switcher .auth-open-btn__label {
    font-size: 11px;
  }

  .theme-switcher .auth-open-btn.is-guest {
    width: auto;
    min-width: 1.9rem;
    padding: 0 10px;
    border-radius: 999px;
  }

  html[data-auth-visual-state="guest"] .theme-switcher .auth-open-btn:not(.is-auth) {
    width: auto;
    min-width: 1.9rem;
    padding: 0 10px;
    border-radius: 999px;
  }

  .auth-card {
    width: min(78vw, 252px);
    padding: 0.58rem 0.62rem;
  }

  .auth-card h3 {
    font-size: 0.86rem;
  }

  .auth-text {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .auth-identity {
    margin-top: 0.42rem;
    gap: 0.3rem;
  }

  .auth-chip-row {
    gap: 0.28rem;
  }

  .auth-chip {
    min-height: 28px;
    padding: 0.32rem 0.5rem;
    font-size: 0.68rem;
  }

  .auth-user-email {
    font-size: 0.7rem;
  }

  .auth-level-wrap {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin-top: 0.38rem;
  }

  .auth-oauth-row {
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin-top: 0.38rem;
  }

  .auth-oauth-btn {
    font-size: 0.72rem;
    padding: 0.42rem 0.52rem;
    gap: 0.35rem;
  }

  .auth-oauth-icon {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .auth-email-toggle {
    margin-top: 0.34rem;
    font-size: 0.66rem;
  }

  .auth-select {
    min-height: 28px;
    font-size: 0.68rem;
    padding: 0.32rem 2rem 0.32rem 0.5rem;
    background-position: right 12px center;
  }

  .auth-email-input {
    margin-top: 0.42rem;
    padding: 0.46rem 0.5rem;
    font-size: 0.78rem;
  }

  .auth-email-error {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .auth-status {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
  }

  .auth-legal-note {
    margin-top: 0.44rem;
    font-size: 0.62rem;
  }

  .auth-actions {
    margin-top: 0.52rem;
    gap: 0.36rem;
  }

  .auth-send-btn,
  .auth-close-btn {
    padding: 0.38rem 0.62rem;
    font-size: 0.72rem;
  }

  .auth-sync-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .auth-modal.compact-auth .auth-card {
    width: min(238px, 74vw);
    padding: 0.4rem 0.42rem;
  }

  .auth-modal.compact-auth .auth-card h3 {
    font-size: 0.72rem;
    margin-bottom: 0.14rem;
  }

  .auth-modal.compact-auth .auth-text {
    font-size: 0.68rem;
    margin: 0.14rem 0;
  }

  .auth-modal.compact-auth .auth-identity {
    margin-top: 0.18rem;
    gap: 0.18rem;
  }

  .auth-modal.compact-auth .auth-chip {
    max-width: 100%;
    min-height: 22px;
    padding: 0.24rem 0.4rem;
    font-size: 0.6rem;
  }

  .auth-modal.compact-auth .auth-user-email {
    font-size: 0.6rem;
  }

  .auth-modal.compact-auth .auth-status {
    min-height: 0;
    margin: 0;
  }

  .auth-modal.compact-auth .auth-actions {
    justify-content: center;
    margin-top: 0.22rem;
    gap: 0.2rem;
  }

  .auth-modal.compact-auth .auth-send-btn,
  .auth-modal.compact-auth .auth-close-btn {
    padding: 0.24rem 0.36rem;
    font-size: 0.58rem;
  }

  .auth-modal.compact-auth .auth-sync-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .auth-oauth-btn {
    justify-content: center;
    gap: 0;
    padding-inline: 0.42rem;
  }

  .auth-oauth-btn span:last-child {
    display: none;
  }
}

/* Иконки */
.lightToggleIcon_pyhR,
.darkToggleIcon_wfgR {
  display: none;
}
html[data-theme="light"] .lightToggleIcon_pyhR {
  display: block;
}
html[data-theme="dark"] .darkToggleIcon_wfgR {
  display: block;
}
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .lightToggleIcon_pyhR {
    display: block;
  }
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .darkToggleIcon_wfgR {
    display: block;
  }
}

@media (max-width: 600px) {
  a, b {
    margin-top: 7px;
    margin-bottom: 7px;
  }
}

@media (max-width: 600px) {
  .site-header nav a,
  .site-header nav b {
    margin-top: 0;
    margin-bottom: 0;
  }
}

@media (pointer: coarse) {
  html {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;

    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;

    touch-action: manipulation !important;
  }
}
