/* Статические стили внутренних страниц */

/* === Оболочка (квест, рейтинг) === */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: #f2f4f7;
}

.app-shell__header {
  flex-shrink: 0;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 1rem;
}

.app-shell__header .app-header-title {
  margin-top: 0;
}

.app-shell__body {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(5.75rem + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* === Страницы входа / регистрации === */
.app-form-page {
  min-height: 100svh;
  background: #f2f4f7;
}

.app-form-page__hero {
  padding: 1.5rem 1.25rem 2rem;
  background: linear-gradient(135deg, #0a0033 0%, #1a0044 55%, #8e54e9 100%);
  color: #ffffff;
}

.app-form-page__hero .app-container {
  padding: 0;
}

.app-form-page__title {
  margin: 1rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.app-form-page__event {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.72);
}

.app-form-card {
  width: calc(100% - 2rem);
  max-width: 32rem;
  margin: -1.25rem auto 2rem;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 8px 32px rgba(10, 0, 51, 0.1);
}

/* === Базовые элементы === */
.app-container {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.app-back {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #8e54e9;
  text-decoration: none;
}

.app-back--light {
  color: rgba(255, 255, 255, 0.88);
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.app-form--tight {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.app-stand-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-footer-text {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(10, 0, 51, 0.55);
}

.app-link {
  font-weight: 600;
  color: #8e54e9;
  text-decoration: none;
}

.app-link--underline {
  font-weight: 500;
  text-decoration: underline;
}

.app-error {
  margin: 0;
  font-size: 0.875rem;
  color: #dc2626;
}

.app-muted {
  color: rgba(10, 0, 51, 0.55);
}

.app-page--center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  background: #f2f4f7;
}

/* === Поля ввода === */
.app-field {
  width: 100%;
}

.app-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(10, 0, 51, 0.75);
}

.app-input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: #0a0033;
  background: #f8f9fc;
  border: 1px solid #e4e7ec;
  border-radius: 0.875rem;
  outline: none;
}

.app-input:focus {
  background: #ffffff;
  border-color: #8e54e9;
  box-shadow: 0 0 0 3px rgba(142, 84, 233, 0.15);
}

.app-input--error {
  border-color: #dc2626;
}

.app-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(10, 0, 51, 0.75);
}

.app-checkbox-row input {
  margin-top: 0.2rem;
  accent-color: #8e54e9;
}

/* === Карточки === */
.app-card {
  box-sizing: border-box;
  width: 100%;
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(10, 0, 51, 0.06);
}

.app-card--stand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.375rem;
}

/* === Шапка === */
.app-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 32rem;
  margin: 0 auto;
}

.app-header-name {
  margin: 0;
  font-weight: 600;
  color: #fff;
}

.app-header-id {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.app-header-day {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.app-header-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: #fff;
}

/* === Статистика квеста === */
.app-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0;
  align-items: stretch;
}

.app-stat-card {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-height: 4.25rem;
  background: #fff;
  border-radius: 1rem;
  padding: 0.875rem;
  box-shadow: 0 2px 12px rgba(10, 0, 51, 0.06);
}

.app-stat-label {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(10, 0, 51, 0.5);
  line-height: 1.35;
}

.app-stat-label__meta {
  font-weight: 500;
  color: rgba(10, 0, 51, 0.42);
}

.app-stat-value__meta {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(10, 0, 51, 0.42);
}

.app-stat-value {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-stat-value--purple { color: #8e54e9; }
.app-stat-value--orange { color: #f37021; }
.app-stat-value--teal { color: #2e7d95; }

.app-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.app-progress-label { font-weight: 500; color: #0a0033; }
.app-progress-count { color: rgba(10, 0, 51, 0.55); }

.app-progress-track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 9999px;
  background: #e4e7ec;
}

/* === Стенд === */
.app-stand-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8e54e9;
}

.app-stand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
}

.app-stand-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 1rem;
}

.app-stand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.375rem;
}

.app-stand-number {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0a0033;
}

.app-stand-title {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(10, 0, 51, 0.65);
}

.app-stand-hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(10, 0, 51, 0.55);
}

.app-skip-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.625rem 0 0.125rem;
  min-height: 2.75rem;
  font-size: 0.8125rem;
  color: rgba(10, 0, 51, 0.45);
  text-align: center;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app-skip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.app-empty {
  text-align: center;
  color: rgba(10, 0, 51, 0.55);
}

.app-warning {
  margin: 0;
  font-size: 0.875rem;
  color: #d97706;
}

/* === Правила === */
.app-rules-page {
  min-height: 100svh;
  background: #f2f4f7;
}

.app-rules-header {
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 1.25rem;
}

.app-rules-header__inner {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.app-rules-header__title {
  margin: 0.625rem 0 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
}

.app-rules-header__sub {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

.app-rules-body {
  max-width: 32rem;
  margin: 0 auto;
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom));
}

.app-rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-rules-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(10, 0, 51, 0.8);
}

.app-rules-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #f37021;
  background: rgba(243, 112, 33, 0.12);
  border-radius: 9999px;
}

.app-rules-note {
  margin-top: 1.25rem;
  padding: 1rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(10, 0, 51, 0.55);
  background: #f2f4f7;
  border-radius: 0.875rem;
}

.app-rules-note p {
  margin: 0;
}

.app-rules-note p + p {
  margin-top: 0.625rem;
}

.app-policy {
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(10, 0, 51, 0.78);
}

.app-policy__lead {
  margin: 0 0 1.125rem;
  font-weight: 600;
  color: #0a0033;
}

.app-policy__section + .app-policy__section {
  margin-top: 1.125rem;
}

.app-policy__section h2 {
  margin: 0 0 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 800;
  color: #0a0033;
}

.app-policy__section p {
  margin: 0;
}

.app-policy__section p + p {
  margin-top: 0.5rem;
}

.app-actions { margin-top: 1.25rem; }

.app-actions--stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* === Рейтинг === */
.app-shell__header--rating {
  padding-bottom: 1rem;
}

.app-shell--rating .app-shell__body {
  padding-top: 1rem;
}

.app-rating-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin-top: 0.875rem;
  padding: 0.25rem;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.875rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.app-rating-tabs::-webkit-scrollbar {
  display: none;
}

.app-rating-tabs__btn {
  flex: 1 0 auto;
  min-width: 4.5rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.app-rating-tabs__btn--active {
  color: #1a114b;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(10, 0, 51, 0.14);
}

.app-rating-tabs__single {
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #1a114b;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(10, 0, 51, 0.14);
}

.app-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.app-tabs::-webkit-scrollbar {
  display: none;
}

.app-tabs .summit-pill,
.app-tabs .app-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

.app-tab {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(10, 0, 51, 0.65);
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 9999px;
  cursor: pointer;
}

.app-rating-card {
  overflow: hidden;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 2px 12px rgba(10, 0, 51, 0.06);
}

.app-rating-head,
.app-rating-row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
}

.app-rating-card--scores .app-rating-head,
.app-rating-card--scores .app-rating-row {
  grid-template-columns: 1.5rem minmax(0, 1fr) repeat(3, minmax(1.6rem, 2.25rem));
}

.app-rating-head {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(10, 0, 51, 0.4);
  border-bottom: 1px solid #e4e7ec;
}

.app-rating-card--scores .app-rating-head span:nth-child(n + 3),
.app-rating-card--scores .app-rating-row > span:nth-child(n + 3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.app-rating-quest {
  font-weight: 600;
  color: #f37021;
}

.app-rating-ai {
  font-weight: 600;
  color: #2e7d95;
}

.app-rating-total {
  font-weight: 700;
  color: #8e54e9;
}

.app-rating-row {
  border-top: 1px solid #f0f1f5;
}

.app-rating-row--me {
  background: rgba(142, 84, 233, 0.08);
}

.app-rating-rank {
  font-weight: 700;
  color: rgba(10, 0, 51, 0.4);
}

.app-rating-rank--top { color: #f37021; }

.app-rating-name {
  margin: 0;
  overflow: hidden;
  font-weight: 600;
  color: #0a0033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-rating-meta {
  margin: 0.1rem 0 0;
  overflow: hidden;
  font-size: 0.75rem;
  color: rgba(10, 0, 51, 0.45);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-rating-points {
  font-weight: 700;
  color: #8e54e9;
}

.app-rating-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(10, 0, 51, 0.45);
}

.app-refresh {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

/* === Иконки === */
.app-icon {
  display: inline-block;
  flex-shrink: 0;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.icon-active {
  color: #5b22f2;
}

.icon-inactive {
  color: #59607f;
}

/* === Нижняя навигация === */
.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0 0.875rem max(0.625rem, env(safe-area-inset-bottom));
  background: transparent;
  border: none;
  pointer-events: none;
}

.app-bottom-nav__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.125rem;
  max-width: 32rem;
  margin: 0 auto;
  padding: 0.4375rem 0.5rem;
  background: #fff;
  border: 1px solid rgba(10, 0, 51, 0.06);
  border-radius: 999px;
  box-shadow:
    0 8px 28px rgba(10, 0, 51, 0.1),
    0 2px 8px rgba(10, 0, 51, 0.05);
}

.app-bottom-nav__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-width: 0;
  padding: 0.375rem 0.375rem;
  border-radius: 999px;
  font-size: 0.625rem;
  line-height: 1.15;
  font-weight: 500;
  color: #59607f;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.app-bottom-nav__link--active {
  background: #f3effb;
  color: #5b22f2;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(91, 34, 242, 0.08);
}

.app-bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.app-bottom-nav__icon svg,
.app-bottom-nav__icon .app-icon {
  width: 1.375rem;
  height: 1.375rem;
}

.app-bottom-nav__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-bottom-nav__link--pending {
  opacity: 0.72;
  pointer-events: none;
}

.app-bottom-nav__link--pending .app-bottom-nav__icon {
  animation: app-nav-pulse 0.9s ease-in-out infinite;
}

@keyframes app-nav-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.92);
    opacity: 0.65;
  }
}

/* === Индикатор перехода между страницами === */
.app-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  background: rgba(91, 34, 242, 0.08);
}

.app-nav-progress__bar {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, rgba(91, 34, 242, 0.45), #5b22f2, rgba(142, 84, 233, 0.75));
  animation: app-nav-progress-slide 0.9s ease-in-out infinite;
}

@keyframes app-nav-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* === Завершение дня === */
.app-day-done {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 8rem;
  text-align: center;
  color: #fff;
}

.app-day-done__emoji,
.app-day-done__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffcf73;
}

.app-day-done__icon svg,
.app-day-done__icon .app-icon {
  width: 2.25rem;
  height: 2.25rem;
}

.app-day-done__emoji {
  font-size: 3.75rem;
  margin: 0;
  background: none;
  width: auto;
  height: auto;
}

.app-day-done__title {
  margin: 1rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.app-day-done__sub {
  margin: 0.5rem 0 0;
  color: rgba(255, 255, 255, 0.8);
}

.app-day-done .app-coach {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  text-align: left;
}

.app-day-done .app-cert-promo {
  margin-top: 1rem;
  text-align: left;
}

.app-day-done .app-actions--stack {
  margin-top: 1.5rem;
  gap: 0.875rem;
}

.app-day-done .app-coach + .app-cert-promo {
  margin-top: 1rem;
}

.app-shell__body > .app-coach {
  margin-top: 0;
}

.app-stat-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 2rem;
}

.app-stat-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.app-day-done__stats-row {
  margin-top: 0.75rem;
}

.app-stat-split {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8e7a9e;
}

.summit-stage-bg .app-stat-split,
.app-quest-paused__stat-split {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.app-quest-paused__stat-split {
  display: block;
}

.app-stat-box {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}

.app-stat-box__label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.app-stat-box__value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.app-shell--quest {
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}

.app-shell--quest .app-shell__header {
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 1rem;
}

.app-shell--quest .app-shell__body {
  gap: 0.75rem;
  padding: 0.75rem 1rem calc(5.75rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-shell--quest .app-stat-card,
.app-shell--quest .app-card,
.app-shell--quest .app-coach,
.app-shell--quest .app-cert-promo {
  padding: 1rem;
  border-radius: 1rem;
}

.app-shell--quest .app-stat-card {
  min-height: 4rem;
}

.app-shell--quest .app-stat-value {
  font-size: 1rem;
}

.app-shell--quest .app-card--stand {
  gap: 0.75rem;
}

.app-shell--quest .app-stand-cta {
  padding: 0.5rem 0.625rem;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, rgba(243, 112, 33, 0.1), rgba(142, 84, 233, 0.08));
  border: 1px solid rgba(243, 112, 33, 0.22);
}

.app-shell--quest .app-stand-cta__text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(10, 0, 51, 0.75);
}

.app-shell--quest .app-stand-cta__text strong {
  color: #0a0033;
}

.app-shell--quest .app-stand-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
}

.app-shell--quest .app-stand-number {
  font-size: 1.25rem;
}

.app-shell--quest .app-stand-hint {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.app-shell--quest .app-stand-form {
  gap: 0.5rem;
}

.app-shell--quest .app-input {
  padding: 0.75rem 0.875rem;
  font-size: 0.9375rem;
}

.app-shell--quest .summit-pill--lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
}

/* === Диалог подтверждения === */
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 0, 51, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.app-dialog {
  width: 100%;
  max-width: 20rem;
  padding: 1.25rem;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 16px 48px rgba(10, 0, 51, 0.2);
}

.app-dialog__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0a0033;
}

.app-dialog__text {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(10, 0, 51, 0.65);
}

.app-dialog__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.125rem;
}

.app-dialog__actions--single {
  flex-direction: column;
}

.app-dialog__actions--single .app-dialog__btn--confirm {
  width: 100%;
}

.app-dialog__btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}

.app-dialog__btn--cancel {
  color: rgba(10, 0, 51, 0.7);
  background: #f2f4f7;
}

.app-dialog__btn--confirm {
  color: #ffffff;
  background: #f37021;
}

.app-header-logout {
  flex-shrink: 0;
  min-height: 2.25rem;
  margin-top: 0;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.6875rem !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 0.625rem !important;
}

.app-header-logout:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

/* === AI-квиз === */
.ai-quiz-stat {
  min-height: auto;
}

.ai-quiz-stat__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(10, 0, 51, 0.45);
}

.ai-quiz-intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(10, 0, 51, 0.65);
}

.ai-quiz-error {
  margin-bottom: 1rem;
}

.ai-quiz-resume {
  margin-bottom: 1rem;
  padding: 1rem;
}

.ai-quiz-resume__text {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(10, 0, 51, 0.75);
}

.ai-quiz-topics {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.ai-quiz-topic-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ai-quiz-topic-retry {
  align-self: flex-start;
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #8e54e9;
  background: none;
  border: none;
  cursor: pointer;
}

.ai-quiz-topic-retry:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-quiz-question-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: rgba(10, 0, 51, 0.5);
}

.ai-quiz-text-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-quiz-text-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: #0a0033;
  background: #fff;
  border: 1px solid #d8dce3;
  border-radius: 0.875rem;
}

.ai-quiz-text-input:focus {
  outline: none;
  border-color: #8e54e9;
  box-shadow: 0 0 0 3px rgba(142, 84, 233, 0.15);
}

.ai-quiz-feedback__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ai-quiz-topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0a0033;
  text-align: center;
  background: #e8eaed;
  border: 1px solid #d8dce3;
  border-radius: 0.875rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.ai-quiz-topic:hover:not(:disabled) {
  filter: brightness(0.97);
}

.ai-quiz-topic:active:not(:disabled) {
  transform: scale(0.99);
}

.ai-quiz-topic:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ai-quiz-topic--done {
  background: #f0f7f4;
  border-color: #c5e6d4;
}

.ai-quiz-topic__title {
  display: block;
}

.ai-quiz-topic__badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(10, 0, 51, 0.55);
}

.ai-quiz-topic__badge--progress {
  color: #8e54e9;
}

.ai-quiz-play__header {
  margin-bottom: 1rem;
}

.ai-quiz-back {
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #8e54e9;
  background: none;
  border: none;
  cursor: pointer;
}

.ai-quiz-play__topic {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(10, 0, 51, 0.55);
}

.ai-quiz-play__progress {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0033;
}

.ai-quiz-question-card {
  margin-bottom: 1rem;
}

.ai-quiz-difficulty {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.625rem;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.ai-quiz-difficulty--basic {
  background: rgba(46, 125, 149, 0.12);
  color: #2e7d95;
}

.ai-quiz-difficulty--standard {
  background: rgba(142, 84, 233, 0.12);
  color: #8e54e9;
}

.ai-quiz-difficulty--advanced {
  background: rgba(243, 112, 33, 0.14);
  color: #c84f0e;
}

.ai-quiz-question {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #0a0033;
}

.ai-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.ai-quiz-option {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  color: #0a0033;
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.ai-quiz-option:hover:not(:disabled) {
  border-color: #8e54e9;
  background: rgba(142, 84, 233, 0.04);
}

.ai-quiz-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-quiz-feedback {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-quiz-feedback--correct {
  border: 1px solid #c5e6d4;
  background: #f0faf4;
}

.ai-quiz-feedback--wrong {
  border: 1px solid #f5d0c8;
  background: #fff8f6;
}

.ai-quiz-feedback__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0a0033;
}

.ai-quiz-feedback__answer {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #c0392b;
}

.ai-quiz-feedback__explanation {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(10, 0, 51, 0.7);
}

.ai-quiz-feedback__score {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(10, 0, 51, 0.5);
}

/* === AI-квиз: индикатор «думает» === */
.ai-quiz-thinking-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: rgba(242, 244, 247, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 1.25rem;
}

.ai-quiz-thinking {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  max-width: 16rem;
  text-align: center;
}

.ai-quiz-thinking--compact {
  gap: 0.625rem;
}

.ai-quiz-thinking__visual {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
}

.ai-quiz-thinking--compact .ai-quiz-thinking__visual {
  width: 3.5rem;
  height: 3.5rem;
}

.ai-quiz-thinking__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ai-quiz-thinking__ring--outer {
  border-top-color: #8e54e9;
  border-right-color: rgba(142, 84, 233, 0.25);
  animation: ai-quiz-spin 1.4s linear infinite;
}

.ai-quiz-thinking__ring--mid {
  inset: 0.5rem;
  border-bottom-color: #2e7d95;
  border-left-color: rgba(46, 125, 149, 0.25);
  animation: ai-quiz-spin 1.1s linear infinite reverse;
}

.ai-quiz-thinking__core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.ai-quiz-thinking__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #8e54e9;
  animation: ai-quiz-pulse 1.2s ease-in-out infinite;
}

.ai-quiz-thinking__dot:nth-child(2) {
  animation-delay: 0.15s;
  background: #2e7d95;
}

.ai-quiz-thinking__dot:nth-child(3) {
  animation-delay: 0.3s;
  background: #f37021;
}

.ai-quiz-thinking__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0a0033;
}

.ai-quiz-thinking--compact .ai-quiz-thinking__title {
  font-size: 0.875rem;
}

.ai-quiz-thinking__subtitle {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(10, 0, 51, 0.55);
}

.ai-quiz-topics-wrap,
.ai-quiz-play {
  position: relative;
  min-height: 12rem;
}

.ai-quiz-topic--loading {
  border-color: rgba(142, 84, 233, 0.35);
  background: rgba(142, 84, 233, 0.06);
}

@keyframes ai-quiz-spin {
  to { transform: rotate(360deg); }
}

@keyframes ai-quiz-pulse {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.85);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px) scale(1);
  }
}

/* === Квест недоступен === */
.app-shell--quest-paused .app-shell__body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.5rem;
}

.app-quest-paused {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  text-align: center;
}

.app-quest-paused__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(142, 84, 233, 0.12), rgba(255, 138, 0, 0.1));
  color: #8e54e9;
  box-shadow: 0 8px 20px rgba(142, 84, 233, 0.12);
}

.app-quest-paused__icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

.app-quest-paused__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: #1e1b2e;
}

.app-quest-paused__message {
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #6b6280;
}

.app-quest-paused__schedule {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(142, 84, 233, 0.08), rgba(255, 138, 0, 0.08));
  border: 1px solid rgba(142, 84, 233, 0.12);
  text-align: left;
}

.app-quest-paused__schedule-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.app-quest-paused__schedule-row + .app-quest-paused__schedule-row {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(142, 84, 233, 0.1);
}

.app-quest-paused__schedule-label {
  color: #8a819c;
}

.app-quest-paused__schedule-value {
  font-weight: 600;
  color: #4a3f63;
  text-align: right;
}

.app-quest-paused__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-top: 1rem;
}

.app-quest-paused__stat {
  padding: 0.75rem;
  border-radius: 0.875rem;
  background: #fff;
  border: 1px solid rgba(142, 84, 233, 0.1);
}

.app-quest-paused__stat-label {
  display: block;
  font-size: 0.75rem;
  color: #8a819c;
}

.app-quest-paused__stat-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #8e54e9;
}

.app-quest-paused__suggestions {
  margin-top: 1.5rem;
  text-align: left;
}

.app-quest-paused__suggestions-title {
  margin: 0 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a819c;
}

.app-quest-paused__actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.app-quest-paused__action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(142, 84, 233, 0.12);
  box-shadow: 0 4px 14px rgba(30, 27, 46, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-quest-paused__action:active {
  transform: scale(0.98);
}

.app-quest-paused__action--ai {
  border-color: rgba(20, 184, 166, 0.2);
}

.app-quest-paused__action--rating {
  border-color: rgba(255, 138, 0, 0.2);
}

.app-quest-paused__action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
}

.app-quest-paused__action-icon svg,
.app-quest-paused__action-icon .app-icon {
  width: 1.375rem;
  height: 1.375rem;
}

.app-quest-paused__action--ai .app-quest-paused__action-icon {
  color: #0d9488;
  background: rgba(20, 184, 166, 0.12);
}

.app-quest-paused__action--rating .app-quest-paused__action-icon {
  color: #ea580c;
  background: rgba(255, 138, 0, 0.12);
}

.app-quest-paused__action-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.app-quest-paused__action-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e1b2e;
}

.app-quest-paused__action-sub {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: #8a819c;
}

.app-quest-paused__action-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: #b8b0c8;
}

.app-quest-paused__action-arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* === AI-совет по квесту === */
.app-coach {
  box-sizing: border-box;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(142, 84, 233, 0.09), rgba(20, 184, 166, 0.08));
  border: 1px solid rgba(142, 84, 233, 0.14);
}

.app-coach__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.app-coach__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  color: #0d9488;
  background: rgba(20, 184, 166, 0.14);
}

.app-coach__icon svg,
.app-coach__icon .app-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.app-coach__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8e54e9;
}

.app-coach__message {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #3d3550;
}

.app-coach__cta {
  display: inline-flex;
  margin-top: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #8e54e9;
  text-decoration: none;
}

.app-coach__cta:active {
  opacity: 0.75;
}

.app-coach--rating {
  border-color: rgba(255, 138, 0, 0.22);
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.08), rgba(142, 84, 233, 0.06));
}

.app-coach--rating .app-coach__label {
  color: #ea580c;
}

.app-coach--navigation .app-coach__icon {
  color: #8e54e9;
  background: rgba(142, 84, 233, 0.12);
}

.summit-stage-bg .app-coach {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.summit-stage-bg .app-coach__label {
  color: #ffcf73;
}

.summit-stage-bg .app-coach__message {
  color: rgba(255, 255, 255, 0.92);
}

.summit-stage-bg .app-coach__cta {
  color: #ffcf73;
}

.summit-stage-bg .app-coach__icon {
  color: #ffcf73;
  background: rgba(255, 255, 255, 0.12);
}

/* === Сертификат участника === */
.app-shell--certificate .app-shell__body {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

.cert-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 0.25rem;
}

.cert-loading__card {
  width: 100%;
  max-width: 24rem;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(145deg, #1a114b 0%, #2d1b69 48%, #12082e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-loading__shimmer {
  border-radius: 0.5rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.08) 100%
  );
  background-size: 200% 100%;
  animation: cert-shimmer 1.4s ease-in-out infinite;
}

.cert-loading__line {
  height: 0.75rem;
  margin-bottom: 0.625rem;
}

.cert-loading__line--xs {
  width: 42%;
  height: 0.625rem;
}

.cert-loading__line--sm {
  width: 58%;
}

.cert-loading__line--md {
  width: 78%;
}

.cert-loading__line--lg {
  width: 72%;
  height: 1.125rem;
  margin-top: 0.75rem;
}

.cert-loading__badge {
  width: 11rem;
  height: 1.375rem;
  border-radius: 999px;
  margin: 0.75rem 0 1rem;
}

.cert-loading__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin: 1rem 0;
}

.cert-loading__stat {
  height: 4rem;
  border-radius: 0.875rem;
}

.cert-loading__title {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: #3d3550;
  text-align: center;
}

.cert-loading__sub {
  margin: 0;
  font-size: 0.875rem;
  color: #8a819c;
  text-align: center;
  line-height: 1.4;
}

@keyframes cert-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.cert-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-wrap--compact .cert-actions {
  display: none;
}

.cert-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  border-radius: 1.25rem;
  color: #fff;
  background: linear-gradient(145deg, #1a114b 0%, #2d1b69 48%, #12082e 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(26, 17, 75, 0.28);
}

.cert-card__glow {
  position: absolute;
  top: -3rem;
  right: -2rem;
  width: 9rem;
  height: 9rem;
  border-radius: 999px;
  background: rgba(255, 138, 0, 0.18);
  filter: blur(8px);
  pointer-events: none;
}

.cert-card__header,
.cert-card__identity,
.cert-card__stats,
.cert-card__summary,
.cert-card__footer {
  position: relative;
  z-index: 1;
}

.cert-card__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.cert-card__logo {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  object-fit: contain;
}

.cert-card__brand-text {
  min-width: 0;
}

.cert-card__event {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.88);
}

.cert-card__dates {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.cert-card__badge {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a114b;
  background: #ffcf73;
}

.cert-card__name {
  margin: 1rem 0 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.cert-card__id {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
}

.cert-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-top: 1rem;
}

.cert-card__stat {
  padding: 0.75rem;
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-card__stat-label {
  display: block;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.55);
}

.cert-card__stat-value {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.375rem;
  font-weight: 700;
}

.cert-card__stat-value--accent {
  color: #ff8a00;
}

.cert-card__summary {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.cert-card__footer {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-card__rank,
.cert-card__percentile {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
}

.cert-card__percentile {
  margin-top: 0.35rem;
}

.cert-card__rank strong,
.cert-card__percentile strong {
  color: #ffcf73;
}

.cert-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.cert-actions__error {
  margin: 0;
  text-align: center;
}

.cert-actions__notice {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0d9488;
}

.cert-actions__hint {
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
  color: #8a819c;
}

.cert-empty {
  padding: 1.25rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(142, 84, 233, 0.12);
  text-align: center;
}

.cert-empty__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e1b2e;
}

.cert-empty__text {
  margin: 0.625rem 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #6b6280;
}

.cert-preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.cert-preview__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 51, 0.72);
}

.cert-preview__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 24rem;
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  padding: 1rem;
  border-radius: 1.25rem;
  background: #fff;
}

.cert-preview__hint {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #6b6280;
  text-align: center;
}

.cert-preview__image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.875rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(26, 17, 75, 0.18);
}

.app-cert-promo {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, rgba(255, 207, 115, 0.16), rgba(142, 84, 233, 0.1));
  border: 1px solid rgba(255, 207, 115, 0.35);
  box-shadow: 0 4px 14px rgba(26, 17, 75, 0.06);
}

.app-cert-promo:active {
  transform: scale(0.99);
}

.app-cert-promo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  color: #b45309;
  background: rgba(255, 207, 115, 0.35);
}

.app-cert-promo__icon svg,
.app-cert-promo__icon .app-icon {
  width: 1.375rem;
  height: 1.375rem;
}

.app-cert-promo__body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.app-cert-promo__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1e1b2e;
}

.app-cert-promo__sub {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: #6b6280;
}

.app-cert-promo__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: #b8b0c8;
}

.app-cert-promo__arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

.app-cert-promo--compact .app-cert-promo__sub {
  font-size: 0.75rem;
}

.summit-stage-bg .app-cert-promo,
.app-cert-promo--dark {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 207, 115, 0.35);
}

.summit-stage-bg .app-cert-promo__title,
.app-cert-promo--dark .app-cert-promo__title {
  color: #fff;
}

.summit-stage-bg .app-cert-promo__sub,
.app-cert-promo--dark .app-cert-promo__sub {
  color: rgba(255, 255, 255, 0.72);
}

.summit-stage-bg .app-cert-promo__icon,
.app-cert-promo--dark .app-cert-promo__icon {
  color: #ffcf73;
  background: rgba(255, 255, 255, 0.12);
}

/* === Техподдержка === */
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.support-link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  color: #fff;
  text-align: left;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.support-link--compact {
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 0.625rem;
}

.support-link__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
}

.support-link--compact .support-link__icon {
  width: 1.25rem;
  height: 1.25rem;
}

.support-link__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.support-link__badge {
  position: absolute;
  top: -0.625rem;
  right: -0.625rem;
  display: inline-flex;
  min-width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  background: #f37021;
  border: 2px solid #3a1674;
  box-shadow: 0 0.25rem 0.75rem rgba(10, 0, 51, 0.2);
}

.support-link__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.support-link__text span {
  font-size: 0.875rem;
  font-weight: 800;
}

.support-link__text small {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.72);
}

.app-day-done > .support-link {
  margin-top: 1.25rem;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.support-textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  min-height: 8rem;
  padding: 0.875rem 1rem;
  font: inherit;
  color: #0a0033;
  background: #f8f9fc;
  border: 1px solid #e4e7ec;
  border-radius: 0.875rem;
  outline: none;
}

.support-textarea:focus {
  background: #fff;
  border-color: #8e54e9;
  box-shadow: 0 0 0 3px rgba(142, 84, 233, 0.15);
}

.app-success {
  margin: 0;
  font-size: 0.875rem;
  color: #15803d;
}

.support-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.support-list__title {
  margin: 0.25rem 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0a0033;
}

.support-ticket {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1rem !important;
}

.support-ticket__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.support-ticket__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0a0033;
}

.support-ticket__date {
  margin: 0.1875rem 0 0;
  font-size: 0.75rem;
  color: rgba(10, 0, 51, 0.5);
}

.support-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8e54e9;
  background: rgba(142, 84, 233, 0.1);
}

.support-status--open {
  color: #c2410c;
  background: rgba(243, 112, 33, 0.12);
}

.support-status--answered {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.support-ticket__message {
  margin: 0;
  white-space: pre-wrap;
  color: #0a0033;
}

.support-chat {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  border-radius: 1rem;
  padding: 0.75rem;
  background: #f7f8fc;
  border: 1px solid rgba(10, 0, 51, 0.06);
}

.support-chat__row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.support-chat__row--user {
  flex-direction: row-reverse;
}

.support-chat__avatar {
  display: inline-flex;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  color: #fff;
  background: #8e54e9;
}

.support-chat__row--admin .support-chat__avatar {
  background: #2e7d95;
}

.support-chat__message {
  max-width: min(82%, 24rem);
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0.75rem 0.875rem;
  color: #0a0033;
  box-shadow: 0 0.5rem 1.25rem rgba(10, 0, 51, 0.06);
}

.support-chat__message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-chat__message--user {
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: #fff;
  border: 1px solid rgba(142, 84, 233, 0.18);
}

.support-chat__message--admin {
  background: #e8f4f7;
  border: 1px solid rgba(46, 125, 149, 0.22);
}

.support-chat__meta {
  margin-bottom: 0.375rem !important;
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgba(10, 0, 51, 0.55);
}

@media (max-width: 420px) {
  .support-ticket {
    padding: 0.875rem !important;
  }

  .support-chat {
    padding: 0.625rem;
  }

  .support-chat__avatar {
    flex-basis: 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.625rem;
  }

  .support-chat__message {
    max-width: calc(100% - 2.25rem);
  }
}

.support-ticket__answer {
  border-radius: 0.875rem;
  padding: 0.875rem;
  background: rgba(46, 125, 149, 0.1);
  color: #0a0033;
}

.support-ticket__answer p {
  margin: 0;
}

.support-ticket__answer-label {
  margin-bottom: 0.375rem !important;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2e7d95;
}

/* === Оповещения пользователей === */
.user-notification {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 0, 51, 0.58);
  backdrop-filter: blur(6px);
}

.user-notification__panel {
  box-sizing: border-box;
  width: min(100%, 25rem);
  border-radius: 1.25rem;
  padding: 1.25rem;
  color: #0a0033;
  background: #ffffff;
  border: 1px solid rgba(10, 0, 51, 0.08);
  box-shadow: 0 1.5rem 4rem rgba(10, 0, 51, 0.28);
}

.user-notification__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #f37021;
}

.user-notification__panel h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 900;
}

.user-notification__message {
  margin: 0.875rem 0 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: rgba(10, 0, 51, 0.78);
}

.user-notification__panel button {
  display: inline-flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 1.25rem;
  font: inherit;
  font-weight: 800;
  color: #ffffff;
  background: #f37021;
  cursor: pointer;
}

.user-notification__panel button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* === Карта мероприятия === */
.app-shell--map {
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  background: #1a114b;
}

.app-map-header {
  background: linear-gradient(135deg, #0a0033 0%, #1a0044 55%, #8e54e9 100%);
}

.app-shell--map .app-shell__body {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.map-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background: #e8eaef;
}

.map-viewer__stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}

.map-viewer__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.map-viewer__status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.9375rem;
  color: #6b6280;
}

.map-viewer__status--error {
  color: #dc2626;
}

.map-viewer__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(10, 0, 51, 0.45);
  pointer-events: none;
}

.map-viewer__reset {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1a114b;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(10, 0, 51, 0.12);
}

.map-viewer__reset:active {
  transform: scale(0.98);
}
