/* Top inset: keep every header, sheet and close button below the notch / status bar. */
:root{--mf-top:env(safe-area-inset-top,0px)}
.error-banner,.success-banner{padding-top:calc(10px + var(--mf-top))!important}
/* Phone layout polish: tighter spacing, one obvious close/back control on every overlay. */
@media (max-width:560px){
 body{line-height:1.5}
 header.topbar{padding:calc(8px + var(--mf-top)) 12px 8px 12px!important}
 main,body.shell-on main{padding:10px 14px 84px!important}
 .page-title{font-size:20px!important;margin:0 0 8px!important}
 .hero-title{font-size:22px!important}
 h2{font-size:18px}h3{font-size:16px}
 .card{padding:12px 14px!important;margin-bottom:8px}
 .ui-card{margin-bottom:8px}
 .field{margin-bottom:10px}
 .field input,.field textarea,.field select{padding:10px 12px;min-height:44px}
 .field textarea{min-height:72px}
 .field label{margin-bottom:4px}
 .form-group,.form-section{padding:14px!important;margin-bottom:10px!important}
 .form-group>p,.form-section>p,.form-sub,.page-sub,.form-intro{display:none}
 .back-row{position:sticky;top:var(--tb-h,60px);z-index:15;background:var(--bg);margin:0 -14px 8px!important;padding:2px 14px;border-bottom:1px solid var(--border)}
 .back-nav,.back-btn{min-height:44px}
 /* sheets: grp (groups, activity, booking list) */
 .grp-sheet{height:calc(100dvh - var(--mf-top) - 10px)!important;max-height:calc(100dvh - var(--mf-top) - 10px)!important;padding:0 14px 16px!important;gap:10px!important}
 .grp-h{position:sticky;top:0;z-index:5;background:var(--bg);margin:0 -14px;padding:10px 14px;border-bottom:1px solid var(--border)}
 .grp-h h3{font-size:17px!important}
 .grp-back{min-width:76px;min-height:44px;padding:0 14px;border:1px solid var(--accent)!important;border-radius:12px;background:var(--accent-soft)!important;color:var(--text)!important;font-weight:700;font-size:15px}
 /* bottom sheet modals (booking, client self forms) */
 .bk-modal,.csf-modal{max-height:calc(100dvh - var(--mf-top) - 10px)!important;padding:0 14px 16px!important}
 .mf-bar{position:sticky;top:0;z-index:5;display:flex;justify-content:flex-end;background:var(--bg);margin:0 -14px 8px;padding:8px 14px;border-bottom:1px solid var(--border)}
 .mf-x{min-width:84px;min-height:44px;padding:0 16px;border:1px solid var(--accent);border-radius:12px;background:var(--accent-soft);color:var(--text);font:inherit;font-weight:700;font-size:15px;cursor:pointer}
 /* chat */
 .chat-head{min-height:56px!important;padding:calc(6px + var(--mf-top)) 12px 6px!important}
 .chat-title{font-size:16px!important}
 .chat-close{min-width:76px!important;font-size:15px!important;font-weight:700;padding:0 14px;background:var(--accent-soft)!important;border-color:var(--accent)!important}
 .chat-body{padding:10px!important;gap:6px!important}
 .chat-b{max-width:88%!important;padding:7px 11px!important;font-size:14px!important;line-height:1.45!important;border-radius:14px!important}
 .chat-time{font-size:10.5px!important;margin-top:2px!important}
 .chat-row{padding:10px!important}
 .chat-compose{padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important}
 /* notifications panel */
 .notif-panel{top:calc(56px + var(--mf-top))!important}
 .notif-panel-close{min-width:64px;min-height:44px;font-size:15px!important;border:1px solid var(--accent)!important;border-radius:12px;background:var(--accent-soft)!important;color:var(--text)!important;padding:0 12px!important}
 .settings-nav{gap:8px!important}
}

.chat-head{padding-top:calc(8px + var(--mf-top))!important}
.chat-sheet{height:100dvh}

/* v4: nothing may sit under the status bar or show through it. */
body::before{content:"";position:fixed;top:0;left:0;right:0;height:var(--mf-top);background:var(--bg);z-index:100000;pointer-events:none}
header.topbar{background:var(--bg)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body.shell-on .app-sidebar{padding-top:calc(16px + var(--mf-top))!important;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))!important}
.notif-panel{max-height:calc(100dvh - 70px - var(--mf-top))}

/* v5: no blur/glow anywhere at the top; one identical header on every page. */
*,*::before,*::after{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
header.topbar,header.topbar *,.app-sidebar,.app-sidebar *{box-shadow:none!important;text-shadow:none!important;filter:none!important}
.sb-backdrop{background:rgba(0,0,0,.55)!important}
header.topbar{overflow:visible!important;padding:calc(var(--mf-top) + 14px) 14px 12px 14px!important;min-height:calc(var(--mf-top) + 70px);gap:8px!important;flex-wrap:nowrap!important;opacity:1!important}
header.topbar .header-actions{gap:8px!important;flex-shrink:0;overflow:visible!important}
header.topbar .brand,header.topbar .shell-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:18px}
header.topbar .menu-btn,header.topbar .notif-bell,header.topbar .btn-new{width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;flex-shrink:0}
header.topbar .notif-wrap{overflow:visible}
.notif-badge{top:-7px!important;inset-inline-end:-7px!important;min-width:20px!important;height:20px!important;font-size:11px!important;z-index:2;border:2px solid var(--bg)}
@media (max-width:560px){header.topbar .lang-btn{display:none!important}}
.mf-lang{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;margin:0 0 10px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);color:var(--text);font:inherit;font-weight:600;font-size:15px;cursor:pointer}
@media (min-width:561px){.mf-lang{display:none}}

/* v6: flat, solid header controls. No glow, no translucent colours. */
html,body{background:var(--bg)!important}
header.topbar .btn-new,header.topbar .notif-bell,header.topbar .menu-btn{box-shadow:none!important;filter:none!important;opacity:1!important;transition:none!important}
header.topbar .btn-new{background:#b8ebc6!important;border:1px solid #659b74!important}
.notif-badge{background:#C62828!important;color:#fff!important;box-shadow:none!important;opacity:1!important}
