/* Flux interface polish: a staging overlay on the unchanged baseline styles.
   Layout and readability only; colors come from the baseline theme variables. */

/* "Total units" uses gradient text. In dark theme only the dark purple start of
   the gradient showed behind the digits; size it to the number and lighten it. */
:root[data-theme="dark"] .stat.total .v{display:inline-block;
  background:linear-gradient(120deg,#c3a6f0,#f58a4b);
  -webkit-background-clip:text;background-clip:text;color:transparent}

/* Loading: placeholder lines shimmer under "Opening project…"-style states. */
@keyframes flux-shimmer{from{background-position:-60% 0,0 0,0 34px,0 60px,0 98px}to{background-position:160% 0,0 0,0 34px,0 60px,0 98px}}
.workspace-route-state.workspace-route-loading::after{content:"";display:block;max-width:520px;height:118px;margin:24px auto 0;
  background:
    linear-gradient(90deg,transparent,color-mix(in srgb,var(--panel) 75%,transparent),transparent) -60% 0/45% 100% no-repeat,
    linear-gradient(var(--line) 0 0) 0 0/100% 18px no-repeat,
    linear-gradient(var(--line) 0 0) 0 34px/72% 12px no-repeat,
    linear-gradient(var(--line) 0 0) 0 60px/86% 12px no-repeat,
    linear-gradient(var(--line) 0 0) 0 98px/38% 20px no-repeat;
  border-radius:8px;animation:flux-shimmer 1.5s linear infinite}

/* Empty states: a soft panel, a tinted icon and, where the app offers one, the
   next action (motion.js adds a button that presses the app's own action). */
.empty:not(.workspace-route-state){margin:6px 0;border:1px dashed var(--line2);border-radius:16px;
  background:color-mix(in srgb,var(--panel2) 55%,transparent)}
.empty:not(.workspace-route-state) svg{box-sizing:border-box;width:60px;height:60px;padding:15px;border-radius:50%;
  background:color-mix(in srgb,var(--b3) 11%,transparent);color:var(--b3)}
.empty .big{font-size:17px;font-weight:700}
.motion-empty-action{margin:16px auto 0}
.activity-empty .motion-empty-action{margin-top:10px}

/* Header: on wider screens the section tabs stay pinned while you scroll, with a
   soft shadow once the full header is out of view. */
@media (min-width:621px){
  .appnav{position:sticky;top:0;z-index:40}
  .appnav.motion-pinned{box-shadow:0 10px 26px rgba(20,25,35,.12)}
}
/* Tab strips scroll sideways by touch, trackpad or keyboard when they do not fit,
   without a visible scrollbar; motion.js keeps the active tab in view. */
:is(.appnav,.settings-tabs,.file-scope-tabs,.project-workspace-tabs,.unit-tabs){scrollbar-width:none;-ms-overflow-style:none}
:is(.appnav,.settings-tabs,.file-scope-tabs,.project-workspace-tabs,.unit-tabs)::-webkit-scrollbar{display:none}
/* Medium widths: the three-column header (from 761px) no longer pushes the page
   sideways. The search box may shrink and the profile button shows only its
   avatar; its aria-label and title still name the account. */
@media (min-width:761px) and (max-width:1100px){
  header.topbar{grid-template-columns:auto minmax(140px,1fr) auto}
  .profilebtn .profile-copy{display:none}
  #globalSearchInput{text-overflow:ellipsis}
}

/* Five section tabs (alpha.16): Units joins Projects and Settings moves into the
   account menu. The two tabs stay in the page, hidden, for the client's counts. */
.appnav-item[hidden]{display:none!important}
/* Projects / All units switch, beside the section title (own row on phones). */
.sectionbar:has(>.collection-switch){grid-template-columns:auto minmax(0,1fr) auto auto}
.collection-switch{display:inline-flex;gap:2px;padding:3px;border:1px solid var(--line2);border-radius:999px;background:var(--panel2)}
.collection-switch[hidden]{display:none}
.collection-switch button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:5px 13px;border:0;border-radius:999px;
  background:transparent;color:var(--muted);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background .2s ease,color .2s ease}
.collection-switch button:hover{color:var(--ink)}
.collection-switch button[aria-current="page"]{background:var(--sel-fill);color:var(--m3-on-tonal)}
.collection-switch b{font-size:11px;font-weight:600;opacity:.75}
.collection-switch button:focus-visible{outline:2px solid var(--m3-primary);outline-offset:1px}
@media (max-width:620px){.sectionbar>.collection-switch{grid-column:1/-1;justify-self:start}}

/* Account menu on the profile button: a dropdown on wider screens, a sheet above
   the floating tab bar on phones. The button is marked while a Settings page is open. */
.account-center{position:relative}
.profilebtn .profile-chevron{transition:transform .2s ease}
.profilebtn[aria-expanded="true"] .profile-chevron{transform:rotate(180deg)}
.profilebtn.is-current,.profilebtn[aria-expanded="true"]{border-color:var(--m3-primary)}
.account-menu{position:absolute;z-index:150;top:calc(100% + 9px);right:0;width:260px;padding:6px;border:1px solid var(--line2);
  border-radius:16px;background:var(--panel);box-shadow:0 18px 48px rgba(20,25,35,.18);animation:account-menu-in .18s var(--motion-soft,ease)}
.account-menu[hidden]{display:none}
@keyframes account-menu-in{from{opacity:0;transform:translateY(-4px)}}
.account-menu-head{display:flex;align-items:center;gap:10px;padding:8px 8px 12px;margin-bottom:4px;border-bottom:1px solid var(--line)}
.account-menu-head strong,.account-menu-head span>span{display:block}
.account-menu-head strong{font-size:13px;color:var(--ink)}
.account-menu-head span>span{margin-top:2px;font-size:11.5px;color:var(--muted)}
.account-menu-item{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:8px 10px;border:0;border-radius:10px;
  background:transparent;color:var(--ink);font:inherit;font-size:13px;text-align:left;cursor:pointer}
.account-menu-item[hidden]{display:none}
.account-menu-item:hover,.account-menu-item:focus-visible{background:var(--m3-tonal);color:var(--m3-on-tonal);outline:0}
.account-menu-item::before{content:"";flex:none;width:17px;height:17px;background:currentColor;opacity:.8;
  -webkit-mask:var(--menu-icon) center/contain no-repeat;mask:var(--menu-icon) center/contain no-repeat}
.account-menu-item b{margin-left:auto;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--m3-primary);color:#fff;font-size:11px;text-align:center}
.account-menu-separator{height:1px;margin:4px 6px;background:var(--line)}
#accountMenuLogout{color:var(--muted)}
[data-account-icon="account"]{--menu-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E")}
[data-account-icon="display"]{--menu-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E")}
[data-account-icon="sync"]{--menu-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpolyline points='1 20 1 14 7 14'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15'/%3E%3C/svg%3E")}
[data-account-icon="notifications"]{--menu-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E")}
[data-account-icon="administration"]{--menu-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E")}
[data-account-icon="logout"]{--menu-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E")}
@media (max-width:620px){
  .account-menu{position:fixed;top:auto;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:950;width:auto;
    padding:8px 8px 10px;border-radius:24px;box-shadow:0 -10px 40px rgba(20,25,35,.22);animation-name:account-sheet-in}
  @keyframes account-sheet-in{from{opacity:0;transform:translateY(16px)}}
  .account-menu-item{min-height:46px;font-size:14px}
}

/* Section tab icons at every width (inline SVG masks drawn in the text color,
   paths adapted from Feather Icons, MIT). They replace the baseline glyphs; on
   wider screens they sit next to the label, on phones they stand alone. */
.appnav-item>span{display:none}
.appnav-item::before{content:"";flex:none;width:16px;height:16px;background:currentColor;
  -webkit-mask:var(--nav-icon) center/contain no-repeat;mask:var(--nav-icon) center/contain no-repeat}
/* Home: house. Projects: briefcase. Units: equipment rack. Discussions: chat
   bubble. Insights: bar chart. Files: document. Settings: gear. */
#navHome{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E")}
#navProjects{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/%3E%3C/svg%3E")}
#navUnits{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='8' rx='2'/%3E%3Crect x='2' y='14' width='20' height='8' rx='2'/%3E%3Cline x1='6' y1='6' x2='6.01' y2='6'/%3E%3Cline x1='6' y1='18' x2='6.01' y2='18'/%3E%3C/svg%3E")}
#navDiscussions{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E")}
#navInsights{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E")}
#navFiles{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E")}
#navSettings{--nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E")}

/* Phones: the section tabs become a floating icon bar within thumb reach.
   Labels are hidden visually; each button keeps its text as its accessible name. */
@media (max-width:620px){
  .appnav{position:fixed;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));top:auto;z-index:900;margin:0;
    gap:2px;justify-content:space-between;padding:6px;overflow:visible;border:1px solid var(--line);border-radius:30px;
    background:color-mix(in srgb,var(--panel) 82%,transparent);-webkit-backdrop-filter:blur(18px) saturate(1.4);
    backdrop-filter:blur(18px) saturate(1.4);box-shadow:0 10px 30px rgba(20,25,35,.18);
    transition:transform .35s var(--motion-soft,ease)}
  /* motion.js hides the bar while scrolling down and brings it back on scroll up. */
  .appnav.motion-nav-hidden{transform:translateY(calc(100% + 16px + env(safe-area-inset-bottom)))}
  /* gap:0 and centering keep the icon in the middle of its pill: the baseline's
     7px gap to the hidden label pushed it off-centre. */
  .appnav-item{position:relative;z-index:1;flex:1 1 0;min-width:0;height:46px;gap:0;justify-content:center;padding:0;border:0;
    border-radius:23px;font-size:0;color:var(--muted);background:transparent}
  .appnav-item::before{width:24px;height:24px}
  .appnav-item.active{color:var(--ink);background:color-mix(in srgb,var(--ink) 9%,transparent)}
  .appnav-item>span,.appnav-item>b,.appnav-item.active::after{display:none}
  /* With motion.js the highlight is one pill that glides between icons with a
     soft overshoot, and the newly active icon gives a small pop. */
  .appnav.motion-glide .appnav-item.active{background:transparent}
  .motion-glider.motion-glider-pill{z-index:0;height:46px;border-radius:23px;background:color-mix(in srgb,var(--ink) 9%,transparent);
    transition:transform .5s cubic-bezier(.34,1.45,.64,1),width .5s cubic-bezier(.34,1.45,.64,1),opacity .2s ease}
  .motion-glider.motion-glider-pill.motion-glide-instant{transition:none}
  .appnav.motion-glide .appnav-item.active::before{animation:flux-nav-pop .45s cubic-bezier(.34,1.56,.64,1)}
  @keyframes flux-nav-pop{0%{transform:scale(.82)}55%{transform:scale(1.12)}100%{transform:none}}
  body{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .toast{bottom:calc(88px + env(safe-area-inset-bottom))}
}

/* ---- Sign-in screen: light sketch panel (client/signin-art.html) beside a
   Material-style card. Hand-drawn lines use the same script as "Flux"; motion
   draws them in once, then idles gently. Reduced motion shows them finished. ---- */
:root{--sk-ink:#5d4f7d;--sk-note:#7a6a9a;--sk-dash:#b9aed3;--sk-lilac:#a98bdc;--sk-peach:#ef9f6a;--sk-mint:#5fae84;
  --sk-bg:linear-gradient(160deg,#f5effc 0%,#fbf4ee 58%,#fdeee2 100%);--sk-title:#4a3d66;
  --m3-outline:#8e8798;--m3-primary:#6b52a8;--m3-tonal:#ece4f8;--m3-tonal-hover:#e2d6f5;--m3-on-tonal:#2b1d4a}
:root[data-theme="dark"]{--sk-ink:#cbbde6;--sk-note:#b9a9da;--sk-dash:#5c5270;--sk-lilac:#b9a0ec;--sk-peach:#f0aa7c;--sk-mint:#7fc9a0;
  --sk-bg:linear-gradient(160deg,#211c2b 0%,#272029 55%,#2b221f 100%);--sk-title:#e2d8f5;
  --m3-outline:#8a8296;--m3-primary:#cdb8ff;--m3-tonal:#3a3150;--m3-tonal-hover:#463b60;--m3-on-tonal:#efe6ff}

.gate-art{display:flex;flex-direction:column;justify-content:center;gap:16px;padding:44px 56px;background:var(--sk-bg);color:var(--sk-ink)}
.gate-art-title{margin:0;font-family:"Flux Script","Segoe Print",cursive;font-weight:600;font-size:clamp(32px,3.4vw,48px);
  line-height:1.05;color:var(--sk-title);transform:rotate(-1.5deg);transform-origin:left center;animation:flux-rise .7s var(--motion-soft,ease) both}
.gate-sketch{display:block;width:100%;max-width:540px;height:auto}
.gate-art-points{display:flex;flex-wrap:wrap;gap:6px 22px;margin:0;padding:0;list-style:none;font-family:"Flux Script","Segoe Print",cursive;font-size:22px;color:var(--sk-note)}
.gate-art-points li::before{content:"\2713";margin-right:7px;color:var(--sk-peach)}

.sk-line{stroke:var(--sk-ink);stroke-width:2.4;stroke-dasharray:1;animation:sk-draw 1.6s var(--motion-soft,ease) both}
.sk-ghost{stroke:var(--sk-ink);stroke-width:1.2;opacity:.35;animation:sk-fade 1.2s .9s both}
.sk-accent{stroke-width:2.6;stroke-dasharray:1;animation:sk-draw 1s 1.2s both}
.sk-lilac{stroke:var(--sk-lilac)}.sk-peach{stroke:var(--sk-peach)}.sk-mint{stroke:var(--sk-mint)}
.sk-dash{stroke:var(--sk-dash);stroke-width:1.6;stroke-dasharray:6 7;animation:sk-fade 1s 1.1s both}
.sk-blade{fill:color-mix(in srgb,var(--sk-lilac) 22%,transparent)}
.sk-led{stroke:none;animation:sk-fade .6s 1.3s both,sk-blink 3.2s 2s ease-in-out infinite}.sk-ok{fill:var(--sk-mint)}.sk-wait{fill:var(--sk-peach)}
.sk-note{font-family:"Flux Script","Segoe Print",cursive;font-weight:600;font-size:22px;fill:var(--sk-note);stroke:none;animation:sk-fade 1s 1.5s both}
.sk-crac .sk-line{animation-delay:.25s}.sk-ups .sk-line{animation-delay:.45s}.sk-cloud .sk-line{animation-delay:.65s}
.sk-fan{transform-box:view-box;transform-origin:291px 236px;animation:sk-spin 9s 1.6s linear infinite}
.sk-cloud{animation:sk-float 6s 1.6s ease-in-out infinite alternate}
@keyframes sk-draw{from{stroke-dashoffset:1}}
@keyframes sk-fade{from{opacity:0}}
@keyframes sk-spin{to{transform:rotate(360deg)}}
@keyframes sk-float{to{transform:translateY(-6px)}}
@keyframes sk-blink{50%{opacity:.4}}

/* Material-style card, segmented tabs, outlined fields with floating labels. */
#gateBox{border:0;border-radius:28px;box-shadow:0 1px 3px rgba(40,30,60,.08),0 8px 24px rgba(40,30,60,.06)}
.auth-tabs{grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-top:26px;border:1px solid var(--m3-outline);border-radius:999px;border-bottom-width:1px}
.auth-tab{margin:0;padding:10px 8px;border:0;border-radius:999px;font-size:14px;font-weight:600;color:var(--muted);transition:background-color .2s ease,color .2s ease}
.auth-tab.active{background:var(--sel-fill);color:var(--m3-on-tonal);border:0}
.auth-tab.active::before{content:"\2713";margin-right:6px}
.auth-field{position:relative;display:block;text-transform:none;letter-spacing:0;font-weight:500}
.auth-field>span{position:absolute;left:12px;top:17px;z-index:1;max-width:calc(100% - 24px);padding:0 4px;overflow:hidden;
  white-space:nowrap;text-overflow:ellipsis;font-size:15px;line-height:1.3;color:var(--muted);background:var(--panel);pointer-events:none;
  transition:top .18s var(--motion-soft,ease),font-size .18s var(--motion-soft,ease),color .18s ease}
.auth-field input{min-height:56px;padding:16px 14px 14px;border:1px solid var(--m3-outline);border-radius:12px;background:transparent;font-size:16px}
.auth-field input:focus{border-color:var(--m3-primary);box-shadow:inset 0 0 0 1px var(--m3-primary)}
.auth-field:focus-within>span,.auth-field.is-filled>span,.auth-field:has(input[placeholder])>span{top:-9px;font-size:12px}
.auth-field:focus-within>span{color:var(--m3-primary)}
.auth-field input:-webkit-autofill{animation:flux-autofill 1ms}
.auth-password{position:relative;min-width:0}
.auth-password .auth-field input{padding-inline-end:60px}
.password-toggle{position:absolute;inset-inline-end:6px;top:6px;display:grid;place-items:center;width:44px;height:44px;
  margin:0;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer}
.password-toggle:hover{background:var(--m3-tonal);color:var(--m3-on-tonal)}
.password-toggle:focus-visible{outline:2px solid var(--m3-primary);outline-offset:1px}
.password-toggle svg{display:block;width:22px;height:22px;pointer-events:none}
.password-toggle svg[hidden]{display:none}
@keyframes flux-autofill{from{opacity:1}to{opacity:1}}
.gbtn{min-height:50px;border-radius:999px;background:var(--sel-fill);color:var(--m3-on-tonal);font-weight:600;box-shadow:none;filter:none;
  transition:background-color .2s ease,box-shadow .2s ease,transform var(--motion-press,.1s) ease}
.gbtn:hover:not(:disabled){background:var(--sel-fill-hover);filter:none;box-shadow:0 1px 3px rgba(40,30,60,.18)}
.gbtn:focus-visible{outline:2px solid var(--m3-primary);outline-offset:3px}

/* Wide screens: sketch panel beside the card. Phones: sketch band with the card
   rising over it like a sheet. */
@media (min-width:900px){
  #gate:not([hidden]){display:grid;grid-template-columns:minmax(0,1.05fr) minmax(420px,1fr);align-items:start;padding:0}
  .gate-art{position:sticky;top:0;min-height:100dvh}
  #gateBox{margin:max(32px,8vh) auto 32px;max-width:440px;padding:40px 40px 24px}
}
@media (max-width:899px){
  #gate:not([hidden]){display:block;padding:0}
  .gate-art{padding:26px 22px 60px;gap:10px}
  .gate-art-title{font-size:32px}
  .gate-sketch{max-width:420px;max-height:190px;margin:0 auto}
  .gate-art-points{display:none}
  #gateBox{position:relative;margin:-40px 12px 24px;width:auto;max-width:none}
}

/* Upload dialog: Scan to PDF is the only source tile, so it spans the row. */
.upload-source-grid{grid-template-columns:1fr}
.upload-source-grid .upload-source{flex-direction:row;align-items:center;column-gap:12px}
.upload-source-grid .upload-source-icon{margin-bottom:0}
.upload-source-grid .upload-source small{margin-left:auto}

/* ---- Owner-approved concept A (alpha.21): one selected style and one shape
   system across the app. The Ecotel gradient is the only accent (the Settings
   picker is removed). Selected tabs, switches and chips are a pale lilac-to-peach
   gradient; buttons and other brand marks use one simple two-stop purple-to-orange
   gradient instead of the three-stop blend (owner choice E2). ---- */
:root{--sel-fill:linear-gradient(120deg,#ece4f8,#fde7d6);--sel-fill-hover:linear-gradient(120deg,#e2d6f5,#fbd9bf);
  --grad:linear-gradient(120deg,#6b3fb0,#f26a1b)}
:root[data-theme="dark"]{--sel-fill:linear-gradient(120deg,#3a3150,#4a3026);--sel-fill-hover:linear-gradient(120deg,#463b60,#5a3826);
  --m3-on-tonal:#f6ecff;--grad:linear-gradient(120deg,#7b52c4,#f2772e)}
:is(.rolepill.admin,.wn-v){background:var(--sel-fill);color:var(--m3-on-tonal)}
.staging-banner{background:var(--grad)}

/* Selected state: a tonal pill, never an underline, grey panel or outline. */
:is(.appnav-item,.settings-tab,.file-scope-tab,.project-workspace-tab,.unit-tab,.tab,.user-tab,.notification-filter-tabs button){
  border:1px solid transparent;border-radius:999px;transition:background-color .2s ease,color .2s ease}
:is(.appnav-item,.settings-tab,.file-scope-tab,.project-workspace-tab,.unit-tab,.tab,.user-tab,.notification-filter-tabs button):hover:not(.active){color:var(--ink)}
:is(.appnav-item,.settings-tab,.file-scope-tab,.project-workspace-tab,.unit-tab,.tab,.user-tab,.notification-filter-tabs button).active{
  background:var(--sel-fill);color:var(--m3-on-tonal);border-color:transparent;box-shadow:none}
:is(.appnav-item,.settings-tab,.file-scope-tab,.project-workspace-tab,.unit-tab,.tab,.user-tab,.notification-filter-tabs button):focus-visible{outline:2px solid var(--m3-primary);outline-offset:1px}
.appnav-item.active::after{display:none}
/* Underlined strips become rows of pills; the divider line under them stays. */
:is(.unit-tabs,.project-workspace-tabs,.user-tabs){padding-bottom:8px}
:is(.unit-tab,.project-workspace-tab,.user-tab,.tab){margin-bottom:0}
/* The active tab's count badge takes the tonal ink. */
:is(.appnav-item,.unit-tab,.tab,.user-tab,.project-workspace-tab).active :is(b,.cnt,span:not(:empty)){color:inherit}
/* With motion.js one tonal pill glides between section tabs at every width. */
.appnav.motion-glide .appnav-item.active{background:transparent}
.motion-glider.motion-glider-pill{z-index:0;border-radius:999px;background:var(--sel-fill);
  transition:transform .5s cubic-bezier(.34,1.45,.64,1),width .5s cubic-bezier(.34,1.45,.64,1),opacity .2s ease}
.appnav.motion-glide .appnav-item{position:relative;z-index:1}
.account-menu-item:hover,.account-menu-item:focus-visible{background:var(--m3-tonal-hover)}

/* Shapes. Pill: everything you press or that labels a state (buttons, tabs, tab
   groups, chips, badges). 12px: fields and rows inside menus. 16px: surfaces
   that hold content (cards, panels, popovers, dialogs, notices). Tiny marks
   (dots, progress bars, code) keep their own small radii. */
:is(button.btn,.iconbtn,.gbtn,.backbtn,.actbtn,.secondary,.danger,.savebtn,.textbtn,.modalclose,.wn-close,.profilebtn,
  .rolepill,.queuepill,.requestbadge,.verTag,.wn-v,.badge,.hbadge,.tag,.user-status,.phase-tag,.project-record-status,
  .file-secondary-action,.private-viewer-download,.upload-drop-action,.selected-file-remove,.scan-page-action,.password-visibility,
  .appnav,.appnav-item,.appnav-item b,.file-scope-tabs,.unit-tab .cnt,.tab .cnt,.user-tab span,.project-workspace-tab span,
  .notification-btn b,.discussion-badges span,.discussion-reference-pills button,.discussion-comment-chip,.discussion-thread-state b,
  .discussion-thread-state em,.discussion-comments-head span,.filter-chip,.compact-filter-btn>span,.project-directory-counts>span,
  .file-detail-meta span,.backup-object-summary span,.pulse){border-radius:999px}
.ufiles .file-item-actions a,.ufiles .file-item-actions button{border-radius:999px}
:root .settings-tabs{border-radius:16px}
@media (max-width:860px){:root .settings-tabs{border-radius:999px}}
:is(.global-search>input,.search input,select.flt,.field input,.field select,.field textarea,.inline-select select,
  .phase-readings input,.battery-readings input,.security-form input,.security-inline-form input,.mfa-enrollment input,
  .security-action-form input,.comment-picker-toggle,.comment-picker-panel>input,.library-project-toggle,.library-project-none,
  .discussion-unit-picker,.discussion-comment-form>textarea,.compact-controls>.search input,.compact-controls .flt,
  .filter-popover select,.scan-filter select,.checkbox-field,.selected-file,.upload-config-note,.upload-source-icon,
  .workspace-action-panel button,.global-search-result,.notification-item,.account-menu-item,.trusted-device,.trusted-current,
  .unit-history-comment,.unit-history-technical,.impact-warning,.backup-limitations-confirm,.backup-warning-summary,
  .backup-technical-details,.display-popover .textbtn,.profile-avatar,.settings-avatar,.equipment-icon,.upload-drop-icon,.discussion-attachment){border-radius:12px}
.comment-picker-upload{border-radius:12px!important}
:is(.stat,.tablecard,.filetable,.full-activity,.activity-view-empty,.modalbox,.wn-box,.notice,.viewer-notice,.toast,.accpop,
  .global-search-results,.workspace-action-panel,.report-preview-toolbar,.report-preview,.report-summary-grid>div,.report-table-wrap,
  .report-empty,.secure-share-notice,.file-focus-banner,.unit-project-stat,.circuit,.home-hero,.file-count,.account-details>div,
  .phase-readings,.battery-readings,.user-create-panel,.user-card,.empty-users,.upload-drop-zone,.upload-source,.scan-builder,
  .scan-page,.upload-progress,.scan-canvas-wrap,.destructive-note,.file-project-group,.file-entry,.security-card,.security-status,
  .mfa-enrollment,.notification-popover,.project-attention-card,.project-health,.project-focus,.settings-panel,.settings-detail-grid>div,
  .settings-value,.project-directory-card,.project-workspace-head,.project-overview-stats>div,.project-profile-grid>div,
  .project-record-list,.discussion-index,.discussion-detail,.discussion-comment,.discussion-comment-form,.comment-picker-panel,
  .insights-summary>div,.insights-panel,.insights-family-card,.filter-popover,.display-popover,
  .insights-equipment-section,.impact-grid>div,.backup-summary>div,.performance-grid>div,.admin-record,.backup-record,
  .backup-restore-preview,.unit-workspace-hero,.unit-workspace-panel,.unit-workspace-fact,.unit-history-entry,.unit-history-current,
  .security-overview>div,.security-action-form){border-radius:16px}
/* Narrow screens keep the edge-to-edge file table the baseline sets. */
#insightsQualityText>div{border-radius:16px}
@media (max-width:860px){:root .filetable{border-radius:0}}
.appnav-item.active b,:is(.project-workspace-tab,.unit-tab,.user-tab).active span,.tab.active .cnt{background:color-mix(in srgb,var(--m3-on-tonal) 14%,transparent);color:inherit}
