/* NOFIRA buttons — solution C. Keep palette colors and component layouts. */
:root{--nf-button-radius:5px}

/* A button has the same corner shape in pages, dialogs, menus and on mobile.
   Card surfaces and form fields retain their own geometry. */
#nofira-app button:not(.nf-list-card):not(.nf-challenge-card):not(.nf-gallery-card):not(.nf-group-post-photo):not(.nf-brand),
#nofira-app #nf-dialog button:not(#nf-shape-override):not(.nf-project-photo-button):not(.nf-group-post-photo):not(.nf-image-button):not(.nf-gallery-card):not(.nf-group-photo-grid button),
#nofira-app #nf-subdialog button:not(#nf-shape-override):not(.nf-project-photo-button):not(.nf-group-post-photo):not(.nf-image-button):not(.nf-gallery-card):not(.nf-group-photo-grid button),
#nofira-app input:is([type="button"],[type="submit"],[type="reset"]),
#nofira-app :is(a.nf-btn,a.nofira-btn,summary.nf-btn),
#nofira-app summary,
.nofira-community-page button:not(.nf-list-card):not(.nf-challenge-card):not(.nf-gallery-card):not(.nf-group-post-photo):not(.nf-brand),
.nofira-community-page input:is([type="button"],[type="submit"],[type="reset"]),
.nofira-landing :is(a.nofira-btn,button),
.nofira-auth-card :is(button,input[type="submit"]),
:is(.nf-group-overlay,.nf-license-dialog,.nf-comment-text-modal) button,
:is(.nf-group-overlay,.nf-license-dialog,.nf-comment-text-modal) .nf-btn{
 border-radius:var(--nf-button-radius)!important;
}

/* The project, series and album comment action used a legacy pill rule.
   Target it directly as well as through the shared button rule. */
.nofira-community-page #nofira-app.nofira-app-root #nf-dialog .nf-comment-form > button.nf-btn.primary,
.nofira-community-page #nofira-app.nofira-app-root #nf-subdialog .nf-comment-form > button.nf-btn.primary,
.nofira-community-page #nofira-app.nofira-app-root #nf-dialog .nf-dialog-head > button[data-close-dialog],
.nofira-community-page #nofira-app.nofira-app-root #nf-subdialog .nf-dialog-head > button[data-close-dialog],
.nofira-community-page #nofira-app.nofira-app-root #nf-dialog .nf-form-actions > button,
.nofira-community-page #nofira-app.nofira-app-root #nf-subdialog .nf-form-actions > button,
.nf-fullscreen-photo-head button,
.nf-cover-crop-dialog button,
.nofira-auth-card .button,
.nofira-community-page input[type="file"]::file-selector-button,
#nofira-app input[type="file"]::file-selector-button{
 border-radius:var(--nf-button-radius)!important;
}

/* Standard text actions share the same dimensions without enlarging icon
   buttons, tabs, photo tiles or navigation items. */
#nofira-app :is(.nf-btn,.nf-add,.nf-notification-filters button,.nf-group-publish,.nf-message-profile-link),
.nofira-landing .nofira-btn,
.nofira-auth-card button,
:is(.nf-group-overlay,.nf-license-dialog,.nf-comment-text-modal) .nf-btn{
 box-sizing:border-box;
 min-height:38px;
 padding:8px 15px;
 line-height:1.25;
 font-weight:650;
}

/* Icon-only controls remain square and centered. */
#nofira-app :is([data-close-dialog],.nf-group-close,.nf-mobile-top-action,#nf-close-navigation,#nf-close-profile-menu),
:is(.nf-group-overlay,.nf-license-dialog,.nf-comment-text-modal) .nf-dialog-head button{
 padding:0!important;
}

@media(max-width:720px){
 #nofira-app :is(.nf-btn,.nf-add,.nf-notification-filters button,.nf-group-publish),
 :is(.nf-group-overlay,.nf-license-dialog,.nf-comment-text-modal) .nf-btn{min-height:42px}
}

/* One close control for every dialog. This matches the square X in the group
   header and overrides the older circular and undersized variants. */
#nofira-app.nofira-app-root #nf-dialog.nf-dialog .nf-dialog-head button[data-close-dialog],
#nofira-app.nofira-app-root #nf-subdialog.nf-dialog .nf-dialog-head button[data-close-dialog],
#nofira-app.nofira-app-root #nf-dialog.nf-group-dialog .nf-group-close,
.nf-group-overlay .nf-dialog-head button[data-close-dialog],
.nf-license-dialog .nf-dialog-head button[data-close-dialog],
.nf-comment-text-modal .nf-dialog-head button[data-close-dialog],
.nf-cover-crop-dialog .nf-dialog-head button[data-cover-cancel],
.nf-fullscreen-photo-head button[aria-label="Chiudi"]{
 box-sizing:border-box!important;
 display:grid!important;
 place-items:center!important;
 flex:0 0 40px!important;
 width:40px!important;
 min-width:40px!important;
 max-width:40px!important;
 height:40px!important;
 min-height:40px!important;
 max-height:40px!important;
 margin:0!important;
 padding:0!important;
 border:1px solid #496178!important;
 border-radius:var(--nf-button-radius)!important;
 background:#172b42!important;
 color:#fff!important;
 font:400 20px/1 system-ui,sans-serif!important;
 text-align:center!important;
 cursor:pointer;
}
