/* Переключатель книг + фиксы iOS Safari */

.book-switcher {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.switcher-btn {
  appearance: none;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  line-height: 1;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, color .2s, background .2s;
}

.switcher-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.switcher-btn.is-active {
  color: #1a1408;
  background: linear-gradient(135deg, #e8c84a, #c9a227);
  border-color: #c9a227;
}

/* iOS Safari: высота и safe-area */
html {
  height: -webkit-fill-available;
}

body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  max-height: 100dvh;
  max-height: -webkit-fill-available;
  overflow: hidden;
}

.bottombar {
  flex-shrink: 0;
  z-index: 40;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  background: rgba(7, 6, 12, .96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar {
  flex-shrink: 0;
  z-index: 40;
  padding-top: max(6px, env(safe-area-inset-top, 0px));
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Хаб — без двух обложек */
.hub-simple {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}

.hub-simple h1 {
  font-family: var(--display);
  color: var(--gold);
  letter-spacing: .3em;
  font-weight: 500;
  font-size: clamp(32px, 10vw, 48px);
  margin: 0 0 8px;
}

.hub-simple p {
  color: var(--ink-soft);
  font-family: var(--serif);
  margin: 0 0 28px;
  max-width: 360px;
  line-height: 1.5;
}

.hub-switch {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 100%);
}

.hub-switch .switcher-btn {
  display: block;
  padding: 16px 20px;
  font-size: 13px;
  border-radius: 14px;
  text-align: center;
}

.hub-switch .switcher-btn small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: .85;
}

.hub-badge {
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: .8;
}

.boot-loading {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 200px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  gap: 12px;
}

.boot-loading::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .book-switcher {
    order: -1;
    width: 100%;
    justify-content: center;
    margin-bottom: 2px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 6px 10px 4px;
  }

  .brand-sub {
    display: none;
  }

  .mobile-nav {
    display: grid !important;
  }

  .mobile-nav-btn {
    display: grid !important;
  }

  .switcher-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 10px;
  }
}
