/* NOFIRA mobile A: a quiet feed, bottom navigation, and one scroll region per dialog. */
.nf-mobile-brand,.nf-mobile-top-action,.nf-mobile-search,.nf-mobile-tools-details{display:none}
/* Desktop pages already show their own heading. The compact header is needed
   only when the personal sidebar disappears. */
@media(min-width:1051px){
 .nofira-community-page #nofira-app .nf-topbar{display:none!important}
}
@media(min-width:721px) and (max-width:1050px){
 .nofira-community-page #nofira-app .nf-topbar{justify-content:flex-end;margin-bottom:8px}
 .nofira-community-page #nofira-app .nf-topbar .nf-view-title{display:none}
}
@media(max-width:720px){
 html,body{max-width:100%;overflow-x:hidden}
 .nofira-community-page #nofira-app .nf-shell{width:100%;padding:0 0 calc(78px + env(safe-area-inset-bottom));}
 .nofira-community-page #nofira-app .nf-main{min-width:0;width:100%;}
 .nofira-community-page #nofira-app .nf-topbar{position:sticky;z-index:100;top:0;display:grid;grid-template-columns:auto minmax(0,1fr) repeat(3,38px);align-items:center;gap:5px;min-height:58px;padding:7px 12px;margin:0;border-bottom:1px solid var(--nf-border,var(--nf-line));background:var(--nf-surface,var(--nf-card));color:var(--nf-ink,var(--nf-text));backdrop-filter:none;}
 body.admin-bar .nofira-community-page #nofira-app .nf-topbar{top:46px}
 .nofira-community-page #nofira-app .nf-mobile-menu-trigger{display:none!important}
 .nofira-community-page #nofira-app .nf-mobile-brand{display:inline-grid;place-items:center;width:35px;height:35px;padding:0;border:0;border-radius:10px;background:var(--nf-tint,var(--nf-blue-050));color:var(--nf-action,var(--nf-blue));cursor:pointer}
 .nofira-community-page #nofira-app .nf-mobile-brand .nf-ink-icon{width:22px;height:22px}
 .nofira-community-page #nofira-app .nf-topbar .nf-view-title{display:block;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;font-size:1.05rem;color:var(--nf-ink,var(--nf-text));}
 .nofira-community-page #nofira-app .nf-mobile-top-action,.nofira-community-page #nofira-app #nf-top-profile{display:inline-grid;place-items:center;width:38px;min-width:38px;height:38px;min-height:38px;margin:0;padding:0;border:1px solid var(--nf-border,var(--nf-line));border-radius:50%;background:var(--nf-surface,var(--nf-card));color:var(--nf-ink,var(--nf-text));font-size:1.2rem;line-height:1;}
 .nofira-community-page #nofira-app #nf-top-profile .nf-top-profile-label{display:none}
 .nofira-community-page #nofira-app #nf-top-profile>span:first-child{font-size:1.1rem}
 .nofira-community-page #nofira-app .nf-mobile-search:not([hidden]){display:flex;position:sticky;z-index:99;top:58px;gap:8px;padding:9px 12px;border-bottom:1px solid var(--nf-border,var(--nf-line));background:var(--nf-surface,var(--nf-card));}
 body.admin-bar .nofira-community-page #nofira-app .nf-mobile-search:not([hidden]){top:104px}
 .nofira-community-page #nofira-app .nf-mobile-search input{flex:1;min-width:0;min-height:42px;padding:9px 12px;border:1px solid var(--nf-field-border,var(--nf-line));border-radius:10px;background:var(--nf-field,var(--nf-card));color:var(--nf-ink,var(--nf-text));font:inherit}
 .nofira-community-page #nofira-app .nf-mobile-search button{padding:8px 13px;border:0;border-radius:10px;background:var(--nf-action,var(--nf-blue));color:var(--nf-on-action,#fff);font:inherit;font-weight:700}
 .nofira-community-page #nofira-app .nf-mobile-tools-details{display:block;margin:9px 12px 12px;border:1px solid var(--nf-border,var(--nf-line));border-radius:12px;background:var(--nf-surface,var(--nf-card));color:var(--nf-ink,var(--nf-text));}
 .nofira-community-page #nofira-app .nf-mobile-tools-details:has(#nf-mobile-page-tools:empty){display:none}
 .nofira-community-page #nofira-app .nf-mobile-tools-details>summary{padding:12px 14px;color:var(--nf-link,var(--nf-blue));font-weight:700;cursor:pointer}
 .nofira-community-page #nofira-app .nf-mobile-page-tools{display:grid;padding:0 10px 10px;border:0;background:transparent;}
 .nofira-community-page #nofira-app .nf-mobile-page-tools>[data-nf-aside-tools]{margin:0;padding:0;border:0;background:transparent;}
 .nofira-community-page #nofira-app .nf-mobile-page-tools:empty{display:none}
 .nofira-community-page #nofira-app #nf-content{min-width:0;width:100%;padding:0 0 6px;}
 .nofira-community-page #nofira-app :is(.nf-photo-card,.nf-share-card){width:calc(100% - 24px);margin:0 12px 12px;border:1px solid var(--nf-border,var(--nf-line));border-radius:14px;overflow:hidden;background:var(--nf-surface,var(--nf-card));box-shadow:none;}
 .nofira-community-page #nofira-app :is(.nf-photo-card,.nf-share-card) :is(.nf-card-head,.nf-card-body){padding:11px 12px;}
 .nofira-community-page #nofira-app .nf-photo-card .nf-image{max-height:70dvh;object-fit:contain}
 .nofira-community-page #nofira-app :is(.nf-panel,.nf-search-page,.nf-settings>.nf-panel,.nf-notification-page,.nf-profile-gallery-panel){min-width:0;max-width:100%;border-color:var(--nf-border,var(--nf-line));}
 .nofira-community-page #nofira-app :is(.nf-project-grid,.nf-editorial-grid,.nf-list-cards,.nf-event-list){grid-template-columns:minmax(0,1fr);gap:12px;padding-inline:12px;}
 .nofira-community-page #nofira-app .nf-section-head{margin:16px 12px 12px;}
 .nofira-community-page #nofira-app :is(.nf-profile-tabs,.nf-feed-tabs){gap:8px;padding:4px 12px;overflow-x:auto;scrollbar-width:none}
 .nofira-community-page #nofira-app :is(.nf-profile-tabs,.nf-feed-tabs) button{flex:0 0 auto;min-height:40px;padding:8px 11px;white-space:nowrap}
 .nofira-community-page #nofira-app .nf-mobile-nav{position:fixed;z-index:8000;right:0;bottom:0;left:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;width:100%;height:calc(64px + env(safe-area-inset-bottom));padding:4px 6px env(safe-area-inset-bottom);border-top:1px solid var(--nf-border,var(--nf-line));background:var(--nf-surface,var(--nf-card));box-shadow:0 -5px 16px rgba(10,22,34,.08);}
 .nofira-community-page #nofira-app .nf-mobile-nav button{display:grid;place-items:center;align-content:center;gap:2px;width:100%;min-width:0;height:54px;margin:0;padding:3px 1px;border:0;border-radius:9px;background:transparent;color:var(--nf-secondary,var(--nf-muted));font:inherit;line-height:1.05;}
 .nofira-community-page #nofira-app .nf-mobile-nav button>span{font-size:19px;line-height:1.1}
 .nofira-community-page #nofira-app .nf-mobile-nav button>small{font-size:.68rem;color:inherit;white-space:nowrap}
 .nofira-community-page #nofira-app .nf-mobile-nav button.active{color:var(--nf-link,var(--nf-blue));font-weight:700}
 .nofira-community-page #nofira-app .nf-mobile-nav #nf-add-mobile{width:46px;height:46px;min-width:46px;justify-self:center;border-radius:13px;background:var(--nf-action,var(--nf-blue))!important;color:var(--nf-on-action,#fff)!important;font-size:1.8rem;line-height:1;}
 .nofira-community-page #nofira-app #nf-navigation-sidebar,.nofira-community-page #nofira-app .nf-aside.nf-profile-menu-visible{position:fixed;z-index:8500;top:12px;bottom:12px;max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--nf-border,var(--nf-line));border-radius:16px;background:var(--nf-surface,var(--nf-card));color:var(--nf-ink,var(--nf-text));}
 .nofira-community-page #nofira-app #nf-navigation-sidebar{left:12px;width:min(360px,calc(100vw - 24px));padding:16px;}
 .nofira-community-page #nofira-app #nf-navigation-sidebar .nf-nav button[data-view="groups"],.nofira-community-page #nofira-app #nf-navigation-sidebar .nf-nav button[data-view="events"]{display:none}
 .nofira-community-page #nofira-app #nf-navigation-sidebar>.nf-add{display:none}
 .nofira-community-page #nofira-app .nf-profile-gallery-panel{border:0;box-shadow:none}
 .nofira-community-page #nofira-app.nofira-app-root .nf-aside.nf-profile-menu-visible{right:12px;bottom:12px;width:min(360px,calc(100vw - 24px));padding:16px;border-color:var(--nf-border,var(--nf-line));background:var(--nf-surface,var(--nf-card));color:var(--nf-ink,var(--nf-text));}
 body.admin-bar .nofira-community-page #nofira-app #nf-navigation-sidebar,body.admin-bar .nofira-community-page #nofira-app .nf-aside.nf-profile-menu-visible{top:58px;max-height:calc(100dvh - 70px)}
 .nofira-community-page #nofira-app .nf-toast{bottom:calc(74px + env(safe-area-inset-bottom))}
 /* Secondary dialogs and forms scroll inside their own frame. */
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog):not(:has(.nf-photo-modal)):not(.nf-group-dialog){box-sizing:border-box;width:calc(100vw - 12px)!important;max-width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important;margin:auto auto 0!important;overflow:hidden!important;border-radius:16px 16px 0 0!important;clip-path:none!important;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog):not(:has(.nf-photo-modal)):not(.nf-group-dialog)>*{box-sizing:border-box;max-height:calc(100dvh - 14px)!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-dialog-head{position:sticky;z-index:6;top:0;background:var(--nf-surface,var(--nf-card))!important;color:var(--nf-ink,var(--nf-text));border-color:var(--nf-border,var(--nf-line));}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) :is(.nf-upload,.nf-simple-form,.nf-group-post-edit-form,.nf-group-photo-selector,.nf-group-batch){min-width:0;max-width:100%;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){max-width:100%;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-form-actions{position:sticky;z-index:5;bottom:0;display:flex;flex-wrap:wrap;gap:8px;background:var(--nf-surface,var(--nf-card));padding-bottom:calc(10px + env(safe-area-inset-bottom));}
 /* Photo details use the same full screen viewer from profile, feed, notifications, and groups. */
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog):has(.nf-photo-modal){position:fixed!important;inset:0!important;box-sizing:border-box;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;padding:0!important;overflow:hidden!important;border:0!important;border-radius:0!important;clip-path:none!important;background:var(--nf-surface,var(--nf-card));}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog)>.nf-photo-modal{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;overflow:hidden!important;background:var(--nf-surface,var(--nf-card));}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-photo-modal>.nf-dialog-head{grid-row:1;flex:0 0 auto;padding:12px 15px;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-photo-modal-grid{grid-row:2;display:block;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-viewer{min-height:220px;max-height:none;padding:14px;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-viewer>img{display:block;max-width:100%;max-height:min(48dvh,520px);object-fit:contain;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-photo-side{max-height:none;min-height:0;padding:16px;overflow:visible;background:var(--nf-surface,var(--nf-card));}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-photo-modal>#nf-comment-form{grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;margin:0;padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--nf-border,var(--nf-line));background:var(--nf-surface,var(--nf-card));}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-photo-modal>#nf-comment-form textarea{box-sizing:border-box;width:100%;min-width:0;min-height:44px!important;max-height:120px;margin:0;padding:10px 12px;resize:vertical;}
 .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog) .nf-photo-modal>#nf-comment-form button{width:auto;min-width:68px;height:44px;margin:0;padding:9px 12px;}
 body.admin-bar .nofira-community-page #nofira-app :is(#nf-dialog,#nf-subdialog):has(.nf-photo-modal){top:46px!important;height:calc(100dvh - 46px)!important;max-height:calc(100dvh - 46px)!important;}
 .nf-group-overlay,.nf-license-dialog,.nf-comment-text-modal{box-sizing:border-box;width:calc(100vw - 12px)!important;max-width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important;margin:auto auto 0!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;border-radius:16px 16px 0 0!important;}
 .nf-group-overlay .nf-dialog-head,.nf-license-dialog .nf-dialog-head,.nf-comment-text-modal .nf-dialog-head{position:sticky;z-index:5;top:0;background:var(--nf-surface,var(--nf-card));}
 .nf-group-batch-card{grid-template-columns:minmax(0,1fr)}
 .nf-group-batch-card>img{position:static;width:100%;height:160px;object-fit:cover}
}
@media(max-width:360px){
 .nofira-community-page #nofira-app .nf-topbar{grid-template-columns:auto minmax(0,1fr) repeat(3,34px);gap:3px;padding-inline:8px}
 .nofira-community-page #nofira-app .nf-mobile-top-action,.nofira-community-page #nofira-app #nf-top-profile{width:34px;min-width:34px;height:34px;min-height:34px}
 .nofira-community-page #nofira-app .nf-mobile-nav button>small{font-size:.62rem}
}
