/* Без серой вспышки при касании на iOS; рамки фокуса — только при работе с клавиатуры (input-mode.js). Поля ввода сохраняют свою подсветку. */
html { -webkit-tap-highlight-color: transparent; }
html[data-input="pointer"] :focus-visible:not(input, textarea, select, [contenteditable]) { outline: none !important; }
:root { --site-header-space: calc(80px + env(safe-area-inset-top, 0px)); }
.site-shell { padding-top: 0; }
.site-shell--landing .dream-atlas { min-height: calc(100vh - var(--site-header-space)); min-height: calc(100svh - var(--site-header-space)); }
.site-header { position: relative; z-index: 40; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: var(--site-header-space); padding: calc(18px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 18px max(24px, env(safe-area-inset-left, 0px)); background: transparent; border: 0; }
.site-header .site-brand { flex-shrink: 0; color: #f6f8fb; font: 900 17px/1.4 Orbitron, sans-serif; letter-spacing: .14em; text-decoration: none; white-space: nowrap; }
.site-brand span { color: var(--dream-accent); }
.site-header-controls { min-width: 0; }
.site-header .account-nav__button { display: inline-block; flex-shrink: 0; white-space: nowrap; padding: 6px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #ffffff80; font: 700 12px/1.5 Orbitron, system-ui, sans-serif; letter-spacing: .12em; text-decoration: none; cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.site-header .account-nav__button:hover { color: #fff; background: #ffffff0d; border-color: #ffffff1a; }
.site-header .account-nav__button:focus-visible { outline: 2px solid var(--dream-accent); outline-offset: 3px; }
.site-header .profile-menu { position: relative; min-width: 0; margin: 0; color: #9aabc0; font: 13px/1.5 system-ui, sans-serif; }
.site-header .profile-menu summary { list-style: none; max-width: min(180px, 40vw); padding: 6px 12px; overflow: visible; text-overflow: ellipsis; white-space: nowrap; border: 1px solid transparent; border-radius: 9999px; cursor: pointer; }
.site-header .profile-menu summary::-webkit-details-marker { display: none; }
.site-header .profile-menu summary:hover, .site-header .profile-menu[open] summary { color: #fff; border-color: #263544; background: #101821; }
.site-header .profile-menu__panel { position: absolute; z-index: 1; right: 0; top: calc(100% + 8px); min-width: 232px; max-width: calc(100vw - 32px); max-height: calc(100svh - var(--site-header-space) - 16px); overflow: auto; padding: 6px; border: 1px solid #263544; border-radius: 10px; background: #080e14; box-shadow: 0 12px 24px #0009; }
.profile-menu__balance { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 6px; padding: 10px 12px 14px; border-bottom: 1px solid #263544; color: #8fa2b6; font: 13px/1.5 system-ui, sans-serif; }
.profile-menu__crystals { display: inline-flex; align-items: center; gap: 5px; color: #edf5fb; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.profile-menu__crystals img { display: block; flex-shrink: 0; object-fit: contain; }
.site-header .profile-menu__panel form { margin: 0; }
.site-header .profile-menu__panel a, .site-header .profile-menu__panel button { display: block; box-sizing: border-box; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: transparent; color: #c8d5e3; font: inherit; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.site-header .profile-menu__panel .profile-menu__balance { display: flex; padding: 10px 12px 14px; border-bottom: 1px solid #263544; border-radius: 6px 6px 0 0; color: #8fa2b6; }
.site-header .profile-menu__panel a:hover, .site-header .profile-menu__panel button:hover { color: #fff; background: #172433; }
.site-header .profile-menu summary:focus-visible, .site-header .profile-menu__panel a:focus-visible, .site-header .profile-menu__panel button:focus-visible, .site-header .site-brand:focus-visible { outline: 2px solid var(--dream-accent); outline-offset: 3px; }
.site-header .profile-menu__panel button:disabled { opacity: .6; cursor: wait; }
.site-shell.auth-action-page { padding: 0; grid-template-rows: auto 1fr auto; }
.site-shell.auth-action-page .auth-action-card { width: min(448px, calc(100% - 32px)); margin: 24px 0; }
.dream-page-tools { display: flex; justify-content: flex-end; padding-top: 16px; }
@media (max-width: 600px) {
  :root { --site-header-space: calc(68px + env(safe-area-inset-top, 0px)); }
  .site-header { gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
  .site-header .site-brand { font-size: 13px; }
  .site-header .profile-menu summary { padding-inline: 10px; font-size: 12px; }
}

.site-header .profile-menu summary { display: flex; align-items: center; gap: 7px; }
.profile-menu__name { overflow: hidden; text-overflow: ellipsis; }
/* Слева в шапке — аватарка с плюсиком, как в Инстаграме: ведёт на добавление сна, справа в меню только имя. На главной и страницах меню круг 40 px вписан в левый торец плашки высотой 52 px. После входа логотип на ПК и планшете строго по центру (боковые колонки равны), на телефоне надпись скрыта: не помещается. docs/MENU_PAGES.md */
.site-add-dream { position: relative; display: block; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: #fff; text-decoration: none; transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.site-add-dream::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.site-add-dream__avatar { display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #2b4f8f, #0b1220); color: #ffffffb3; }
.site-add-dream__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.site-add-dream__avatar svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2; }
.site-add-dream__plus { position: absolute; right: -8px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #1e3a6e; box-shadow: 0 0 0 1px #7dd3fc40; transition: background-color .3s cubic-bezier(.22, 1, .36, 1); }
.site-add-dream__plus svg { display: block; width: 9px; height: 9px; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.site-add-dream__tip { position: absolute; top: calc(100% + 10px); left: 0; z-index: 2; padding: 7px 10px; border: 1px solid #ffffff1a; border-radius: 7px; background: #10151aeb; color: #fff; font: 12px/1.4 system-ui, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
.site-add-dream:focus-visible { outline: 2px solid var(--dream-accent); outline-offset: 3px; }
.site-add-dream:focus-visible .site-add-dream__tip { opacity: 1; visibility: visible; }
@media (hover: hover) {
  .site-add-dream:hover { transform: scale(1.05); }
  .site-add-dream:hover .site-add-dream__plus { background: #28498a; }
  .site-add-dream:hover .site-add-dream__tip { opacity: 1; visibility: visible; }
}
@media (prefers-reduced-motion: reduce) { .site-add-dream, .site-add-dream__plus { transition: none; } .site-add-dream:hover { transform: none; } }
.site-shell--landing .site-add-dream, .site-shell--glass .site-add-dream { width: 40px; height: 40px; }
@media (min-width: 761px) {
  .site-shell .site-header:has(.site-add-dream) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .site-header:has(.site-add-dream) .site-header-controls { display: flex; justify-self: end; }
  /* Без хвостового межбуквенного интервала: буквы логотипа точно по центру плашки */
  .site-header:has(.site-add-dream) .site-brand { margin-right: -.14em; }
}
@media (max-width: 760px) { .site-header:has(.site-add-dream) .site-brand { display: none; } }
.site-shell--landing .site-header:has(.site-add-dream), .site-shell--glass .site-header:has(.site-add-dream) { padding: 6px 8px; }
/* Подсказка кнопки меню. Над короной показывается только её подпись, при открытом меню подсказки нет. docs/MENU_PAGES.md */
.site-header .profile-menu summary { position: relative; }
.profile-menu__tip { position: absolute; top: calc(100% + 10px); right: 0; z-index: 2; padding: 7px 10px; border: 1px solid #ffffff1a; border-radius: 7px; background: #10151aeb; color: #fff; font: 12px/1.4 system-ui, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
.site-header .profile-menu:not([open]) summary:focus-visible .profile-menu__tip { opacity: 1; visibility: visible; }
@media (hover: hover) { .site-header .profile-menu:not([open]) summary:hover:not(:has(.premium-badge:hover)) .profile-menu__tip { opacity: 1; visibility: visible; } }
.premium-badge { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; color: #f3cb70; }
.premium-badge > svg { filter: drop-shadow(0 0 5px #e8b34535); }
.premium-badge[data-expert] { color: #64c7ed; }
.premium-badge[data-expert] > svg { filter: drop-shadow(0 0 5px #64c7ed35); }
.premium-badge[data-expert] > svg path:last-child { stroke: #135276; }
.premium-badge-tooltip { position: absolute; top: calc(100% + 8px); left: 50%; z-index: 2; transform: translateX(-50%); padding: 7px 10px; border: 1px solid #ffffff1a; border-radius: 7px; background: #10151aeb; color: #fff; font: 12px/1.4 system-ui, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
.premium-badge:hover, .premium-badge:focus-visible { z-index: 50; }
.premium-badge:hover .premium-badge-tooltip, .premium-badge:focus-visible .premium-badge-tooltip { opacity: 1; visibility: visible; }
.premium-badge:focus-visible { outline: 2px solid #64c7ed; outline-offset: 3px; border-radius: 3px; }
.site-header .premium-badge-tooltip { left: auto; right: 0; transform: none; }

/* Название сна — h1 страницы сна для читателя, выглядит как обычная подпись карточки (docs/SEO.md). */
.feed-card-title { margin: 0; min-width: 0; font: inherit; }
