/* Без серой вспышки при касании на 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: 1px 1px 1px 10px; 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-left: 8px; font-size: 12px; }
}

.site-header .profile-menu summary { display: flex; align-items: center; gap: 7px; }
.profile-menu__name { overflow: hidden; text-overflow: ellipsis; }
/* Аватарка — круг в правом скруглённом торце кнопки меню, имя слева; без фото — силуэт того же размера. Круг почти во всю высоту капсулы с минимальным зазором 1 px, центр совпадает с центром правого полукруга (на главной и страницах меню 34 px в капсуле 36 px). От имени (или короны) до круга — 70% левого отступа кнопки: 11 px при 16 px (gap 8 + margin-left 3), на простой шапке 7 px при 10 px. docs/MENU_PAGES.md */
.profile-menu__avatar { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #2b4f8f, #0b1220); color: #ffffffb3; }
.profile-menu__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-menu__avatar svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2; }
.site-shell--landing .site-header .profile-menu summary, .site-shell--glass .site-header .profile-menu summary { gap: 8px; padding: 1px 1px 1px 16px; border: 0; }
.site-shell--landing .profile-menu__avatar, .site-shell--glass .profile-menu__avatar { width: 34px; height: 34px; margin-left: 3px; }
.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; }
