/* Шапка сайта и меню разделов (разметку дорисовывает pz-nav.js).
   Подключают все страницы, включая главную, — поэтому только переменные
   палитры, никаких сбросов body. */
:root { --pz-top-h: 46px; }

.pz-top {
  position: sticky;
  top: 0;
  z-index: 30;
  box-sizing: border-box;
  border-bottom: 1px solid var(--pz-hairline, var(--border));
  background: color-mix(in srgb, var(--surface-1, var(--panel)) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  transition: transform 0.25s ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.pz-top.pz-top-away { transform: translateY(-100%); }
.pz-top-in {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1180px;
  height: calc(var(--pz-top-h) - 1px); /* 1px — нижняя граница шапки */
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.pz-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.pz-brand img { width: 26px; height: 26px; object-fit: contain; }
.pz-brand b { color: var(--accent); font-weight: inherit; }
.pz-current { display: none; }
.pz-nav { display: flex; min-width: 0; flex: 1; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.pz-nav::-webkit-scrollbar { display: none; }
.pz-nav a {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pz-nav a:hover { background: var(--surface-3); color: var(--text); }
.pz-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-medium); }
.pz-top-actions { display: flex; flex: none; align-items: center; gap: 6px; margin-left: auto; }

.pz-menu-btn, .pz-sheet-head button {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--pz-hairline, var(--border));
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
}
.pz-menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- главная: шапка только над плеером (десктоп) ----------
   Шапка живёт в колонке плеера, а чат справа идёт от самого верха экрана —
   над чатом не остаётся пустой полосы. Плеер ужимается под шапку. */
.pz-top-main { position: relative; z-index: 6; }
.pz-top-main .pz-top-in { max-width: none; }
@media (min-width: 801px) {
  .stage:has(> .pz-top-main) { flex-direction: column; align-items: stretch; }
  .stage:has(> .pz-top-main) > .player { flex: 1 1 0; min-height: 0; height: auto; }
}
html.chat-only .pz-top-main { display: none; }
/* На главной кнопка меню живёт в шапке чата и видна только на телефоне. */
.pz-chat-menu { display: none !important; }

/* ---------- выезжающее меню разделов ---------- */
.pz-sheet { position: fixed; z-index: 90; inset: 0; }
.pz-sheet[hidden] { display: none; }
.pz-sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.45); animation: pz-fade 0.2s ease; }
.pz-sheet-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 100dvh;
  overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--pz-hairline, var(--border));
  border-radius: 0 0 18px 18px;
  background: var(--surface-1, var(--panel));
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.3);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  animation: pz-drop 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pz-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.pz-sheet-head strong { font-size: 16px; font-weight: 850; letter-spacing: -0.04em; }
.pz-sheet-head strong b { color: var(--accent); }
.pz-sheet-head button { display: grid; font-size: 20px; line-height: 1; }
.pz-sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 10px 7px 7px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.pz-sheet-row:hover, .pz-sheet-row:active { background: var(--surface-2); }
.pz-sheet-row[aria-current="page"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-medium); }
.pz-sheet-row > span:last-child { display: grid; min-width: 0; }
.pz-sheet-row strong { font-size: 15px; font-weight: 700; }
.pz-sheet-row small { color: var(--muted); font-size: 12.5px; }
.pz-sheet-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--accent);
}
.pz-sheet-icon svg { width: 19px; height: 19px; fill: currentColor; }
.pz-sheet-extra { display: flex; gap: 16px; padding: 8px 10px 2px; border-top: 1px solid var(--pz-hairline, var(--border)); margin-top: 4px; }
.pz-sheet-extra a { color: var(--muted); font-size: 13px; text-decoration: none; }
html.pz-sheet-open, html.pz-sheet-open body { overflow: hidden; }
@keyframes pz-drop { from { transform: translateY(-100%); } }
@keyframes pz-fade { from { opacity: 0; } }

/* ---------- телефон: вместо ряда разделов — текущий раздел и кнопка меню ---------- */
@media (max-width: 800px) {
  .pz-top-in { gap: 10px; }
  .pz-nav { display: none; }
  .pz-current {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
  }
  .pz-menu-btn { display: grid; }
  /* Главная на телефоне: шапки нет, плеер начинается с самого верха. */
  .pz-top-main { display: none; }
  html:not(.chat-only) .pz-chat-menu { display: grid !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pz-top, .pz-sheet-card, .pz-sheet-backdrop { animation: none; transition: none; }
}
