/* v33: компактная навигация и понятный вход/регистрация */
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-nav > a,
.nav-more-button {
  white-space: nowrap;
}

.site-nav > a {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-more {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-more-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 9px 13px;
  min-height: 38px;
  color: #0f2a57;
  background: rgba(255, 255, 255, .9);
  font: inherit;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.nav-more-button::after {
  content: '⌄';
  margin-left: 7px;
  color: #5b6b85;
  font-size: 13px;
}

.nav-more-button:hover,
.nav-more-button.active,
.nav-more.open .nav-more-button {
  transform: translateY(-1px);
  background: #eef3ff;
  color: #1f4fd6;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .16);
}

.nav-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 300;
  min-width: 230px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(148, 163, 184, .22);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  display: none;
}

.nav-more.open .nav-more-menu,
.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu {
  display: grid;
  gap: 5px;
  animation: navMenuIn .14s ease both;
}

.nav-more-menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #172033;
  text-decoration: none;
  font-weight: 800;
  background: transparent;
}

.nav-more-menu a:hover,
.nav-more-menu a.active {
  background: #eef3ff;
  color: #2457d6;
}

@keyframes navMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-body {
  color: #172033;
}

.auth-modal-body [hidden] {
  display: none !important;
}

.auth-modal-body .auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  margin: 0 0 16px;
  border-radius: 18px;
  background: #eef2ff;
  border: 1px solid rgba(37, 99, 235, .12);
}

.auth-modal-body .auth-switch button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  min-height: 44px;
  cursor: pointer;
  background: transparent;
  color: #334155;
  font: inherit;
  font-weight: 850;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.auth-modal-body .auth-switch button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .62);
}

.auth-modal-body .auth-switch button.active {
  background: #fff;
  color: #2457d6;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .15);
}

.auth-modal-body .auth-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid rgba(148, 163, 184, .22);
  color: #475569;
  line-height: 1.45;
}

.auth-modal-body .auth-form,
.auth-modal-body [data-auth-fields] {
  display: grid;
  gap: 13px;
}

.auth-modal-body .auth-form .field {
  display: grid;
  gap: 7px;
}

.auth-modal-body .auth-form label {
  color: #172033;
  font-weight: 850;
}

.auth-modal-body .auth-form small {
  color: #64748b;
  line-height: 1.35;
}

.auth-modal-body .auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  justify-content: center;
}

.auth-user-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .site-nav > a {
    max-width: 120px;
  }
}

@media (max-width: 760px) {
  .site-nav,
  .nav-more {
    display: none !important;
  }

  .auth-modal-body .auth-switch {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}
