:root{font-family:Arial,Helvetica,sans-serif;color:#202824;background:#f3f5f4;letter-spacing:0;color-scheme:light}
*{box-sizing:border-box}body{margin:0;height:100dvh;overflow:hidden}button{font:inherit;cursor:pointer;border:1px solid #cbd2ce;background:#fff;color:#202824;border-radius:5px}button:hover{background:#edf3ef}button:focus-visible{outline:3px solid #188463;outline-offset:2px}[hidden]{display:none!important}
.app-bar{height:54px;padding:0 12px 0 max(12px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #cbd2ce;background:#fff}.brand{display:flex;align-items:center;gap:9px;font-size:16px;font-weight:700;min-width:0}.brand img{border-radius:5px;flex-shrink:0}.brand span{overflow-wrap:anywhere}nav{display:flex;gap:6px;align-items:center;flex-shrink:0}nav button{width:34px;height:34px;display:grid;place-items:center;padding:6px}nav svg{width:18px;height:18px}.update{width:auto!important;display:flex;gap:6px;padding:6px 10px!important;color:#08704b;border-color:#9bcdb9;font-size:12px;font-weight:700}
#workspace{position:relative;height:calc(100dvh - 54px)}#dashboard{width:100%;height:100%;border:0;background:#fff;visibility:hidden}#connection{position:absolute;inset:0;background:#f3f5f4;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:24px;text-align:center;font-size:14px}#connection p{max-width:440px;line-height:1.5}#retry{padding:9px 14px}.spinner{width:24px;height:24px;border:2px solid #c9d2ce;border-top-color:#16835e;border-radius:50%;animation:spin 1s linear infinite}.spinner.failed{animation:none;border:0;width:24px;height:24px;background:#b44332;mask:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M11 3h2v12h-2zM11 18h2v3h-2z"/%3E%3C/svg%3E') center/contain no-repeat}
#notice{position:fixed;left:50%;bottom:max(20px,env(safe-area-inset-bottom));transform:translateX(-50%);max-width:min(560px,calc(100% - 32px));padding:12px 16px;color:#fff;background:#263b30;border-radius:6px;z-index:10;font-size:14px;line-height:1.4}dialog{max-width:420px;width:calc(100% - 32px);border:1px solid #cbd2ce;border-radius:7px;padding:20px}dialog::backdrop{background:#0006}dialog h2{font-size:18px;margin:0 0 12px}dialog p{font-size:14px;line-height:1.5}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.dialog-actions button{padding:9px 12px}.primary{background:#136949;border-color:#136949;color:white}.primary:hover{background:#105b3f}#pull{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:3;padding:6px 12px;border-radius:5px;background:#fff;color:#136949;font-size:12px;box-shadow:0 1px 5px #0002;display:none}
@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:560px){.app-bar{height:88px;flex-wrap:wrap;gap:2px;padding:6px 10px}.brand{width:100%;font-size:15px}.brand img{width:25px;height:25px}nav{width:100%;justify-content:flex-end}#workspace{height:calc(100dvh - 88px)}.update span{font-size:11px}}@media(prefers-reduced-motion:reduce){.spinner{animation:none}}
.app-bar{background:#071526;border-color:#243a55;color:#e8f0fb}.brand{font-size:14px}.brand img{border-radius:0;object-fit:contain;mix-blend-mode:screen;width:48px;height:34px}.brand b{color:#45a1fb;font-weight:700}nav button{color:#d9e8f9;background:#0d233b;border-color:#29486a}nav button:hover{background:#163553}.update{color:#d3edff!important;border-color:#479ae9!important;background:#103e68!important;white-space:nowrap}#workspaceBrand{display:flex;align-items:center;gap:8px;min-width:0;margin-left:auto;font-size:13px}#workspaceBrand img{object-fit:contain;flex:none}#workspaceBrandName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#workspaceBrandLogo[hidden],#workspaceBrand[hidden]{display:none!important}
@media(max-width:900px){#workspaceBrandName{max-width:150px}.brand{font-size:12px;gap:6px}}
@media(max-width:560px){.app-bar{height:112px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:38px 58px;padding:6px 10px}.brand{width:auto;font-size:12px}.brand img{width:38px;height:28px}.brand span{max-width:135px}#workspaceBrand{margin-left:0}#workspaceBrandName{max-width:90px;font-size:11px}#workspaceBrand img{width:38px;height:28px}nav{grid-column:1/-1;justify-content:flex-end;gap:5px}nav button{width:32px;height:32px}.update{padding:5px 8px!important}#workspace{height:calc(100dvh - 112px)}}
body{--app-bar-height:64px}.app-bar{height:var(--app-bar-height);display:flex;flex-wrap:nowrap;gap:12px;padding:8px 12px}.brand{width:auto;gap:8px;font-size:14px}.brand img{width:60px;height:40px}.brand span{max-width:none;display:flex;flex-direction:column;gap:3px}.brand strong{font-size:14px;line-height:1.2}.brand small{font-size:9px;line-height:1.2;color:#9fb5cf;font-weight:400}.brand b{color:#389afa}nav{width:auto;gap:6px}#workspace{height:calc(100dvh - var(--app-bar-height))}
@media(max-width:600px){.brand{gap:6px}.brand img{width:44px;height:30px}.brand strong{font-size:12px}.brand small{font-size:8px}.brand span{max-width:160px}body.signed-in,body.has-toolbar-actions{--app-bar-height:96px}body.signed-in .app-bar,body.has-toolbar-actions .app-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:36px 40px;padding:8px 10px;gap:4px}body.signed-in nav,body.has-toolbar-actions nav{grid-column:1/-1;justify-content:flex-end}#workspaceBrandName{max-width:88px}nav button{width:32px;height:32px}}

/* Tenant branding stays in the authenticated dashboard. */
body.signed-in .app-bar .brand,body.signed-in #workspaceBrand{display:none!important}
body.signed-in .app-bar{justify-content:flex-end}
@media(max-width:600px){body.signed-in{--app-bar-height:56px}body.signed-in .app-bar{display:flex}body.signed-in nav{width:auto}}
/* Only pending updates appear above the existing dashboard controls. */
.app-bar{position:fixed;top:max(8px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));z-index:20;width:auto;height:auto!important;padding:0!important;border:0;background:transparent;display:block!important}
.app-bar .brand,#workspaceBrand,#home,#refresh,#logout,#install{display:none!important}
.app-bar nav{display:flex!important;width:auto;gap:0}
#workspace{height:100dvh!important}
body.signed-in .app-bar{display:block!important}

/* Installation is offered only after the server validates the business workspace. */
#install:not([hidden]){display:flex!important;align-items:center;gap:6px;width:auto;padding:6px 10px;font-weight:700}
.app-bar nav{gap:8px}

#whats-new{display:grid;width:34px;height:34px;background:#103e68;border-color:#479ae9;color:#d3edff}
#release-dialog{width:min(560px,calc(100% - 28px));max-width:560px;max-height:85dvh;overflow:auto;background:#0d1c30;color:#e8f0fb;border:1px solid #426384;border-radius:12px;box-shadow:0 20px 70px #0008}
#release-dialog::backdrop{background:#0009}
#release-content section+section{border-top:1px solid #36516e;margin-top:16px;padding-top:8px}
#release-content h3{font-size:16px;margin:12px 0 4px}#release-content .release-date{font-size:12px;color:#aec1d7;margin:0 0 8px}
#release-content ul{padding-left:22px;font-size:14px;line-height:1.5}#release-content li+li{margin-top:8px}
.release-safety{color:#b9cce1;font-size:12px!important}#release-dialog button{min-height:44px}
@media(max-width:560px){.update span{font-size:10px}.app-bar nav{max-width:calc(100vw - 20px)}}

/* Reserve a toolbar row: app controls never overlap the native Dashboard. */
body{display:flex;flex-direction:column}
body .app-bar,body.signed-in .app-bar{position:relative;top:auto;right:auto;flex:0 0 auto;width:100%;height:auto!important;min-height:46px;padding:max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left))!important;display:flex!important;justify-content:flex-end;background:#071526;border-bottom:1px solid #243a55}
body #workspace{flex:1 1 0;min-height:0;height:auto!important;width:100%}
