/* Existing phone layouts are authoritative. Only the new desktop navigation is
   hidden outside the desktop breakpoint; all existing-element rules live below. */
.desktop-nav { display: none; }

@media (min-width: 1024px) {
    body { --desktop-width: 1080px; --desktop-gutter: 24px; }
    body .header-nav {
        max-width: none !important; height: 80px !important;
        padding: 0 max(var(--desktop-gutter), calc((100vw - var(--desktop-width)) / 2)) !important;
        gap: 30px; border-bottom-color: #ffffff20 !important;
    }
    body .header-nav .logo { height: 44px !important; }
    body .header-nav .hamburger, body .menu-drawer { display: none !important; }
    .desktop-nav {
        display: flex; align-items: center; justify-content: flex-end; gap: 8px;
        min-width: 0; flex: 1; font: 900 16px/1.2 'Intro Cond Black', 'Arial Black', sans-serif;
    }
    .desktop-nav a {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        min-height: 44px; padding: 13px 14px 10px; border: 1px solid transparent;
        border-radius: 999px; color: #bbb; text-decoration: none; white-space: nowrap;
        transition: color .2s ease, background .2s ease, border-color .2s ease;
    }
    .desktop-nav a:hover { color: #fff; background: #ffffff0c; }
    .desktop-nav a[aria-current="page"] { color: #fff; border-color: #ff181f50; background: #ff181f18; }
    .desktop-nav .desktop-account { color: #fff; margin-left: 6px; background: #ffffff0c; border-color: #ffffff20; }
    .desktop-account span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
    .desktop-nav a:focus-visible { outline: 2px solid #ff181f; outline-offset: 3px; }


    /* Preserve the phone's component proportions; only widen collections. */
    body .main-container {box-sizing:border-box;width:100%;max-width:1080px;margin-inline:auto;padding:104px 24px 40px;min-height:100dvh;}
    body .main-container:has(>.auth-card),body .main-container:has(>.bento-section){padding-top:104px!important}
    body .app-container{max-width:520px;padding:24px;box-sizing:border-box}
    body .app-container .main-container:has(>.auth-card){padding:8px 0 24px!important;min-height:0}
    body .auth-card.te-editor-card{max-width:420px}
    body .main-container:has(>.home-hub){padding-top:max(104px,12vh)}
    body .soundtags-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-width:860px;gap:16px;align-items:start}
    body .soundtags-list .empty-state{grid-column:1/-1}
    body .main-container:has(>.bento-section){display:grid;grid-template-columns:repeat(2,minmax(0,360px));justify-content:center;align-content:start;align-items:start;gap:18px;max-width:800px}
    body .main-container>.bento-section{width:100%;margin:0}
    body .main-container:has(>.bento-section)>:is(.ref-card,.auth-back-btn){grid-column:1/-1;justify-self:center}

    body main#prankhub{width:100%;max-width:1040px;padding:24px 24px 40px;box-sizing:border-box}
    /* One toolbar rhythm: search, categories, then title and sorting. */
    body #prankhub>.ph-topline{min-height:48px;margin-bottom:18px;align-items:center}
    body #prankhub .ph-top-actions{align-items:center;gap:10px}
    body #prankhub .ph-upload-link{height:44px;min-height:44px;padding:3px 20px 0;gap:8px;white-space:nowrap}
    body #ph-filters.ph-filters{display:flex;flex-direction:column;gap:12px;margin:0 0 16px}
    body #ph-filters.ph-filters>.ph-search{box-sizing:border-box;width:100%;min-height:48px;margin:0;padding-right:4px}
    body #ph-filters.ph-filters>.ph-tabs{box-sizing:border-box;width:100%;margin:0;gap:6px;padding:5px}
    body #ph-filters .ph-tabs button{height:44px;min-height:44px;gap:9px;padding:2px 12px 0;font-size:16px}
    body #ph-filters .ph-tabs button::after{content:attr(aria-label);padding-top:2px}
    body #ph-filters .ph-tabs button[data-kind=""]::after{content:'Топ'}
    body #ph-filters .ph-tabs button[data-kind="combo"]::after{content:'Комбо'}
    body #ph-filters .ph-tabs button[data-kind="image"]::after{content:'Картинки'}
    body #ph-filters .ph-tabs button[data-kind="audio"]::after{content:'Звуки'}
    body #ph-filters .ph-tabs button svg{flex:none;width:20px;height:20px}
    body #ph-feed-meta{width:100%;min-width:0}
    body #ph-feed-meta>.ph-section-heading{margin:2px 0 0;min-height:44px;gap:16px}
    body #ph-feed-meta>.ph-section-heading h2{margin:0;font-size:23px;line-height:1.2}
    body #ph-feed-meta>.ph-combo-filter{width:220px;max-width:100%;margin:10px 0 0 auto}
    body #ph-feed-meta>.ph-combo-filter[hidden]{display:none}
    body #ph-feed-meta>.ph-section-heading .ph-sort{width:220px}
    body #ph-feed-meta>.ph-section-heading .ph-sort :is(.ph-sort-toggle,.ph-sort-menu){width:100%}
    body #ph-feed.ph-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start}
    body #ph-feed.ph-grid-top{grid-template-columns:repeat(2,minmax(0,1fr))}
    body #ph-feed .ph-card-unit{min-width:0}
    body #prankhub #ph-feed .ph-card .ph-card-actions{display:flex;align-items:center;justify-content:flex-start;gap:14px;padding:0;margin:6px 0 0;min-height:36px}
    body #prankhub #ph-feed .ph-card .ph-card-actions>*{width:auto;min-height:36px;height:36px;flex:none;gap:5px}
    body #prankhub #ph-feed .ph-card .ph-card-actions .ph-bookmark{width:36px;margin-left:auto}
    body #prankhub #ph-feed .ph-card .ph-card-actions svg{width:17px;height:17px}
    body #prankhub #ph-feed .ph-card .ph-card-actions span{font-size:12px}
    body #prankhub #ph-feed .ph-card:not(.ph-card-audio) .ph-card-info{padding:8px 6px 0}
    body #prankhub #ph-feed.ph-grid-top .ph-card:not(.ph-card-audio) .ph-card-info{padding:0 4px 0 0}
    body #prankhub #ph-feed .ph-card-audio{grid-template-columns:44px minmax(0,1fr);gap:0 12px;padding:12px}
    body #prankhub #ph-feed .ph-card-audio :is(.ph-card-visual,.ph-preview){width:44px;height:44px;min-height:44px}
    body #prankhub #ph-feed .ph-card-audio h3{font-size:19px}
    body #prankhub #ph-feed .ph-card-audio .ph-author{font-size:12px}
    body #prankhub #ph-feed .ph-card-audio .ph-card-actions{grid-column:2;grid-row:3;margin-top:5px;gap:12px}
    body #prankhub #ph-more:not([hidden]){display:flex;width:max-content;min-width:180px;max-width:100%;margin:24px auto 0;padding-inline:24px}

    body #te-dialog{width:min(760px,calc(100vw - 64px));max-width:760px;max-height:calc(100dvh - 64px)}
    body #te-dialog #te-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
    body #te-dialog #te-upload{max-width:420px;margin-inline:auto}
    body #ph-dialog{width:min(560px,calc(100vw - 64px));max-width:560px;max-height:calc(100dvh - 64px)}
    body .ph-detail-page.ph-content-sheet{max-width:560px}
    body .ph-upload-page{max-width:520px;margin-inline:auto}

    /* A single reading order in the profile; cards form a bounded two-column grid. */
    body main#prankhub.ph-account-page{max-width:800px}
    body .ph-account-page>:is(.st-account,.ph-account-stats,.ph-account-settings,.ph-account-since){max-width:340px;margin-left:auto;margin-right:auto}
    body .ph-account-page>.ph-my-tags{margin:20px 0}
    body .ph-account-page>#ph-feed{grid-template-columns:repeat(2,minmax(0,1fr))}
    body .ph-account-page .ph-tag-list{grid-template-columns:repeat(2,minmax(0,1fr))}
    body .ph-account-page .ph-tag-list:has(>.ph-tag-card:only-child){grid-template-columns:1fr}
    body .customer-chat-page{top:104px;width:calc(100% - 64px);max-width:800px;height:calc(var(--chat-viewport,100dvh) - 128px);margin:0;border:1px solid #ffffff24;border-radius:36px;overflow:hidden}
    body .customer-messages{padding:20px 24px}
    body :is(a,button,input,textarea,select):focus-visible{outline:2px solid #ff181f;outline-offset:4px}
}
@media (min-width:1024px) and (max-width:1199px){
    .desktop-nav{gap:2px;font-size:14px}.desktop-nav a{padding-inline:10px}.desktop-account span{max-width:100px}
}
