/* Luma Web 1.20.8 — современные окна, меню, верхняя навигация и правая колонка.
   Loaded last. Only presentation: no element, API or behaviour is added here. */

/* ---------- Canvas ---------- */
/* 1.20.4 intended a white feed canvas; the app layout painted gray over it. */
:root:not([data-theme="dark"]) .app-layout:has(.feed-view){background:#fff}

/* ---------- Top navigation ---------- */
.desktop-top{background:color-mix(in srgb,var(--bg) 84%,transparent);-webkit-backdrop-filter:saturate(1.6) blur(16px);backdrop-filter:saturate(1.6) blur(16px)}
:root:not([data-theme="dark"]) .desktop-top{background:rgb(255 255 255 / .86)}
.topbar-nav{gap:2px}
.topbar-nav .nav-item{width:46px;height:46px;border-radius:50%;color:var(--text);transition:background .16s ease,color .16s ease}
.topbar-nav .nav-item>.icon{width:26px;height:26px}
.topbar-nav .nav-item:hover{background:var(--hover);color:var(--text)}
.topbar-nav .nav-item.active:not(.topbar-account){background:transparent;color:var(--text)}
.topbar-nav .nav-item.active:not(.topbar-account):hover{background:var(--hover)}
.topbar-nav .nav-item.active:not(.topbar-account)::after{content:"";position:absolute;left:50%;bottom:2px;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:currentColor}
.nav-item.active .icon-services path{fill:currentColor;stroke:none}
.topbar-nav .nav-item:focus-visible{outline:2px solid var(--text);outline-offset:1px}
.topbar-nav .topbar-account{padding:0}
.topbar-nav .topbar-account>.avatar{width:30px!important;height:30px!important;font-size:12px!important;box-shadow:none}
.topbar-account:is(.active,[aria-expanded="true"]) .avatar{outline:none}
.topbar-search{transition:background .16s ease,border-color .16s ease,box-shadow .16s ease}
.topbar-search:focus-within{box-shadow:0 0 0 4px color-mix(in srgb,var(--text) 6%,transparent)}

/* ---------- Shared windows ---------- */
.modal-overlay:not(.publication-overlay):not(.follow-confirm-overlay){background:rgb(12 12 16 / .44);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
:root[data-theme="dark"] .modal-overlay:not(.publication-overlay):not(.follow-confirm-overlay){background:rgb(0 0 0 / .64)}
.modal:not(.publication-dialog):not(.follow-confirm-dialog){width:min(560px,100%);background:var(--surface);border:0;border-radius:12px;box-shadow:0 1px 2px #0000000f,0 28px 70px -14px #00000052;animation:luma-window-in .2s cubic-bezier(.2,.8,.25,1)}
:root[data-theme="dark"] .modal:not(.publication-dialog):not(.follow-confirm-dialog){background:var(--panel);box-shadow:0 0 0 1px #ffffff12,0 28px 70px -14px #000000b3}
.modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-header{min-height:60px;padding:14px 14px 4px 22px;border-bottom:0;gap:12px}
.modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-header h2{font-size:17px;font-weight:700;line-height:1.3;letter-spacing:-.01em}
.modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-header>.icon-btn{width:36px;height:36px;min-width:36px;min-height:36px;padding:8px;flex:none;background:var(--hover);color:var(--text);border-radius:50%}
.modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-header>.icon-btn:hover{background:color-mix(in srgb,var(--hover) 60%,var(--line))}
.modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-header>.icon-btn .icon{width:18px;height:18px;stroke-width:2.2}
.modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-body{padding:10px 22px 22px}
.modal .btn{border:0;border-radius:8px}
.modal .btn:not(.primary):not(.post-danger){background:var(--hover)}
.modal .btn:not(.primary):not(.post-danger):hover{background:color-mix(in srgb,var(--hover) 60%,var(--line))}
@keyframes luma-window-in{from{opacity:0;transform:translateY(6px) scale(.975)}to{opacity:1;transform:none}}

/* Short action windows read as menus: compact width, full-width rows. */
.modal:has(>.modal-body>.post-menu),.modal:has(>.modal-body>.btn>.icon):not(:has(.theme-choices)),.modal:has(.account-menu-actions){width:min(380px,100%)}
.post-menu{gap:2px}
:is(.post-menu,.modal-body,.account-menu-actions)>:is(.btn:has(>.icon),.btn.danger-text,.btn.publication-delete),.account-menu-actions>.nav-item{
 display:flex;align-items:center;justify-content:flex-start;gap:14px;width:100%;min-height:50px;margin:0;padding:0 14px;
 border:0;border-radius:8px;background:transparent!important;color:var(--text);font-size:15px;font-weight:500;text-align:left;text-decoration:none;transition:background .14s ease}
:is(.post-menu,.modal-body,.account-menu-actions)>:is(.btn:has(>.icon),.btn.danger-text,.btn.publication-delete):hover,.account-menu-actions>.nav-item:hover{background:var(--hover)!important}
:is(.post-menu,.modal-body,.account-menu-actions)>:is(.btn:has(>.icon),.btn.danger-text,.btn.publication-delete) .icon,.account-menu-actions>.nav-item .icon{width:22px;height:22px;flex:none}
:is(.post-menu,.modal-body)>:is(.btn.danger-text,.btn.publication-delete){color:var(--danger)!important;font-weight:600}
.modal-body>.btn.publication-delete+.btn,.modal-body>.btn:has(>.icon)+.btn.publication-delete{margin-top:2px}
.post-confirm-actions,.publication-confirm{gap:8px;margin-top:18px}
.post-confirm-actions>.btn,.publication-confirm>.btn{flex:1;justify-content:center;min-height:46px;border-radius:8px}
.publication-confirm>.btn.publication-delete{background:var(--danger)!important;color:#fff!important}
.post-menu>p,.modal-body>p{margin:0 0 4px;font-size:15px;line-height:1.55;color:var(--text)}

/* Account menu: identity card and grouped rows; desktop opens as a dropdown under the avatar. */
.account-menu-identity{gap:12px;padding:6px 6px 14px;margin:0 0 6px;border-bottom:1px solid var(--line)}
.account-menu-identity strong{font-size:15px;font-weight:700}
.account-menu-identity small{font-size:13px;color:var(--muted)}
.account-menu-actions{gap:2px}
.account-menu-actions>.nav-item.active{color:var(--text);font-weight:600;background:var(--hover)!important}
.account-menu-actions>.nav-item.active .icon{stroke-width:2.2}
.account-menu-actions>.nav-item>span{display:inline!important;position:static!important;width:auto!important;height:auto!important;clip:auto!important;overflow:visible!important}
.account-menu-actions>:last-child{position:relative;margin-top:9px}
.account-menu-actions>:last-child::before{content:"";position:absolute;left:14px;right:14px;top:-6px;height:1px;background:var(--line)}
@media(min-width:701px){
 .modal-overlay:has(.account-menu-actions){align-items:flex-start;justify-content:flex-end;padding:calc(var(--topbar-height) - 6px) max(16px,calc((100vw - 1120px) / 2 + 12px)) 16px 16px;background:rgb(0 0 0 / .06)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
 :root[data-theme="dark"] .modal-overlay:has(.account-menu-actions){background:rgb(0 0 0 / .28)!important}
 .modal:has(.account-menu-actions){width:300px!important;border-radius:10px!important;transform-origin:top right;animation:luma-menu-in .16s cubic-bezier(.2,.8,.25,1)!important}
 .modal:has(.account-menu-actions)>.modal-header{display:none!important}
 .modal:has(.account-menu-actions)>.modal-body{padding:12px 8px 8px!important}
 .modal:has(.account-menu-actions) .account-menu-identity{margin:0 6px 6px;padding:4px 6px 12px}
}
@keyframes luma-menu-in{from{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:none}}

/* Settings and blocked users keep their content; only spacing is tidied. */
.settings-title{font-size:15px;font-weight:700;margin:6px 0 2px}
.settings-description{font-size:14px;color:var(--muted)}
.theme-choice-card{border-radius:10px}
.modal-body>.settings-footnote{margin:14px 0 0;font-size:13px;color:var(--muted)}
.modal-body>.btn.settings-blocked{position:relative;margin-top:22px}
.modal-body>.btn.settings-blocked::before{content:"";position:absolute;left:0;right:0;top:-11px;height:1px;background:var(--line)}

/* Mobile: every window is a bottom sheet with a grab handle. */
@media(max-width:700px){
 .modal:not(.publication-dialog):not(.follow-confirm-dialog){width:100%;border-radius:12px 12px 0 0;animation:luma-sheet-up .24s cubic-bezier(.2,.8,.25,1)}
 .modal:not(.publication-dialog):not(.follow-confirm-dialog)::before{content:"";display:block;flex:none;width:36px;height:4px;margin:8px auto 0;border-radius:2px;background:color-mix(in srgb,var(--muted) 45%,transparent)}
 .modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-header{min-height:52px;padding:6px 12px 2px 20px}
 .modal:not(.publication-dialog):not(.follow-confirm-dialog)>.modal-body{padding:8px 16px max(18px,env(safe-area-inset-bottom))}
 .modal:has(>.modal-body>.post-menu),.modal:has(>.modal-body>.btn>.icon):not(:has(.theme-choices)),.modal:has(.account-menu-actions){width:100%}
}
@keyframes luma-sheet-up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}

/* ---------- Toasts ---------- */
.toast{border:0;border-radius:8px;padding:12px 20px;background:#18181b;color:#fff;font-size:14px;font-weight:500;box-shadow:0 12px 32px -8px #0006}
:root[data-theme="dark"] .toast{background:#f2f2f3;color:#0b0b0c}

/* ---------- «Рекомендации для вас» ---------- */
.people-suggestions-heading h2{font-size:15px;font-weight:700;letter-spacing:-.01em}
.recommendations-all{font-size:13px;font-weight:600;color:var(--text);padding:0 2px}
.recommendations-all:hover{color:var(--muted)}
.people-current-account .people-identity-text strong{font-size:15px;font-weight:700}
.people-suggestions-list .people-identity-text strong{font-weight:600}
.people-suggestions-list .people-identity-text>span,.people-current-account .people-identity-text>span{color:var(--muted)}
.people-suggestions .people-footnote{margin-top:22px;font-size:11px}

/* All recommendations window: content-height list, rows with soft hover. */
.recommendations-dialog{height:auto!important;max-height:min(680px,calc(100dvh - 48px))!important}
.recommendations-dialog .modal-header{border-bottom:0!important;padding:16px 14px 8px 22px!important}
.recommendations-dialog .recommendations-body{padding:2px 12px 14px!important}
.recommendations-dialog .recommendations-list .people-row{min-height:68px;padding:10px 10px!important;border-radius:8px;transition:background .14s ease}
.recommendations-dialog .recommendations-list .people-row:hover{background:var(--hover)}
.recommendations-dialog .recommendations-list .people-identity>.avatar{width:46px!important;height:46px!important}
.recommendations-dialog .people-follow{border-radius:8px!important}
.recommendations-dialog .people-follow::before{border-radius:8px!important}
@media(max-width:700px){.recommendations-dialog{max-height:88dvh!important}}

@media(prefers-reduced-motion:reduce){
 .modal,.modal:has(.account-menu-actions),.topbar-nav .nav-item,.toast,.recommendations-dialog .recommendations-list .people-row,
 :is(.post-menu,.modal-body,.account-menu-actions)>*{animation:none!important;transition:none!important}
}

/* 1.20.9: the mobile publication surface is one edge-to-edge rectangle.
   Keep avatars and circular media controls round; only the surface is square. */
@media(max-width:700px){
 .feed-view .post-card,.feed-view .post-visual,.feed-view .post-footer,
 .feed-view .post-skeleton,.feed-view .skeleton-photo,
 .publication-dialog,.publication-layout,.publication-visual,.publication-side,
 .profile-grid .profile-tile{border-radius:0}
}
