/* TryCleaning manager space: Bricks (2026-09-18).
   A free canvas of resizable "bricks", each hosting one manager view (or one block of the On the phone page).
   Presets are saved per manager (ui-prefs edge function, key "workspace"). Engine: /workspace.js.
   2026-09-22: the Collaborate brick (key "projects") gives its whole body to the Collaborate home and editor,
   which scroll themselves; menus and dialogs inside it place themselves with tcCollab.zoomOf, so the brick's
   CSS zoom (--bz) needs nothing special here. Source of truth: trycleaning-siteworkspace.css */
:root{--ws-top:64px;}
#view-workspace{min-height:calc(100vh - var(--ws-top));}
.ws-bar{position:sticky;top:var(--ws-top);z-index:30;display:flex;align-items:center;justify-content:space-between;gap:0.6rem;flex-wrap:wrap;padding:0.5rem 0.9rem;background:var(--off-white);border-bottom:1px solid var(--line);}
.ws-bar-l,.ws-bar-r{display:flex;align-items:center;gap:0.45rem;flex-wrap:wrap;}
.ws-bar .btn{white-space:nowrap;display:inline-flex;align-items:center;gap:0.35rem;}
.ws-bar .btn[aria-pressed="true"]{background:var(--navy);color:#fff;border-color:var(--navy);}
.ws-preset,.ws-add{position:relative;}
.ws-preset-btn{display:inline-flex;align-items:center;gap:0.45rem;border:1px solid var(--line);background:#fff;color:var(--navy);font-family:Inter,sans-serif;font-weight:700;font-size:0.92rem;padding:0.45rem 0.7rem 0.45rem 0.8rem;border-radius:10px;cursor:pointer;max-width:min(60vw,420px);}
.ws-preset-btn span.name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ws-preset-btn .car{font-size:0.7rem;color:var(--grey);}
.ws-status{font-size:0.74rem;color:var(--grey);min-width:3.5rem;}
.ws-status.err{color:#c0392b;font-weight:700;}
.ws-menu{position:absolute;top:calc(100% + 6px);left:0;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 44px rgba(8,15,46,0.22);padding:0.35rem;min-width:240px;max-width:calc(100vw - 16px);max-height:min(70vh,640px);overflow:auto;overscroll-behavior:contain;z-index:40;}
.ws-menu[hidden]{display:none;}
.ws-add .ws-menu{left:auto;right:0;min-width:280px;}
.ws-menu .mh{font-size:0.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--grey);padding:0.5rem 0.7rem 0.25rem;}
.ws-menu .mi{display:flex;align-items:center;gap:0.5rem;width:100%;border:none;background:transparent;text-align:left;font-family:Inter,sans-serif;font-size:0.84rem;font-weight:600;color:var(--navy);padding:0.45rem 0.7rem;border-radius:8px;cursor:pointer;}
.ws-menu .mi:hover{background:rgba(79,195,247,0.16);}
.ws-menu .mi.on{background:rgba(79,195,247,0.22);}
.ws-menu .mi .nvi{width:16px;height:16px;color:var(--grey);}
.ws-menu .mi.on .nvi{color:var(--navy);}
.ws-menu .mi small{margin-left:auto;font-size:0.7rem;color:var(--grey);font-weight:600;}
.ws-menu .mi.danger{color:#c0392b;}
.ws-menu hr{border:none;border-top:1px solid var(--line);margin:0.3rem 0.4rem;}
.ws-canvas{position:relative;min-height:calc(100vh - var(--ws-top) - 54px);overflow:visible;}
.ws-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--grey);font-size:0.9rem;padding:2rem;pointer-events:none;}
.ws-empty b{color:var(--navy);}
.ws-empty[hidden]{display:none;}
/* the brick */
.brick{position:absolute;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 24px rgba(13,27,75,0.08);overflow:hidden;overflow:clip;min-width:260px;min-height:150px;}
.brick.dragging,.brick.resizing{box-shadow:0 18px 48px rgba(13,27,75,0.26);opacity:0.97;}
.brick.flash{outline:3px solid var(--sky);outline-offset:-3px;}
.brick.j-l{border-top-left-radius:0;border-bottom-left-radius:0;}
.brick.j-r{border-top-right-radius:0;border-bottom-right-radius:0;}
.brick.j-t{border-top-left-radius:0;border-top-right-radius:0;}
.brick.j-b{border-bottom-left-radius:0;border-bottom-right-radius:0;}
.brick.max{position:fixed!important;left:0!important;top:var(--ws-top)!important;width:100vw!important;height:calc(100vh - var(--ws-top))!important;z-index:70!important;border-radius:0;}
.brick-head{display:flex;align-items:center;gap:0.45rem;padding:0.3rem 0.45rem 0.3rem 0.7rem;border-bottom:1px solid var(--line);background:var(--off-white);cursor:grab;user-select:none;-webkit-user-select:none;touch-action:none;flex:0 0 auto;}
.brick.dragging .brick-head{cursor:grabbing;}
.brick-head .nvi{width:16px;height:16px;color:var(--grey);flex:0 0 auto;}
.brick-title{font-size:0.8rem;font-weight:700;color:var(--navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0;}
.brick-tools{display:flex;align-items:center;gap:0.15rem;flex:0 0 auto;}
.brick-tools .bt{border:none;background:transparent;color:var(--grey);width:30px;height:30px;border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-size:1.05rem;font-weight:700;line-height:1;padding:0;}
.brick-tools .bt:hover{background:rgba(79,195,247,0.2);color:var(--navy);}
.brick-tools .bt svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.brick-tools .bt.bt-close:hover{background:rgba(224,115,106,0.18);color:#c0392b;}
.brick-zoom{font-size:0.7rem;font-weight:700;color:var(--grey);min-width:2.6rem;text-align:center;}
.brick-tools .gap{width:14px;}
.brick.nz .bt-minus,.brick.nz .bt-plus,.brick.nz .brick-zoom{display:none;}
.brick-body{flex:1;min-height:0;overflow:auto;position:relative;zoom:var(--bz,1);container-type:inline-size;container-name:brick;}
.brick-body.parts{padding:0.6rem 0.8rem 0.8rem;}
/* resize handles */
.brick-rs{position:absolute;z-index:5;touch-action:none;}
/* 22 Sep 2026: the side and bottom handles sit inside the brick box. At right/bottom -3px they made the
   overflow:hidden brick 3 px scrollable, and focusing an input inside (Ctrl+F in a document) scrolled the
   whole brick, header and all. overflow:clip on .brick also stops any focus scroll where it is supported. */
.brick-rs-r{top:0;right:0;width:9px;height:100%;cursor:ew-resize;}
.brick-rs-b{left:0;bottom:0;height:9px;width:100%;cursor:ns-resize;}
.brick-rs-c{right:0;bottom:0;width:20px;height:20px;cursor:nwse-resize;}
.brick-rs-c::after{content:"";position:absolute;right:4px;bottom:4px;width:9px;height:9px;border-right:2px solid var(--grey);border-bottom:2px solid var(--grey);border-bottom-right-radius:3px;opacity:0.7;}
.brick.max .brick-rs{display:none;}
/* hosted views: fill the brick instead of the page */
.brick-body .wrap{max-width:none;padding:0.6rem;grid-template-columns:1fr;gap:0.8rem;}
@container brick (min-width:900px){ .brick-body .wrap{grid-template-columns:360px minmax(0,1fr);} }
.brick-body .rw-wrap{max-width:none;padding:0.6rem;}
.brick-body .rw-head p{display:none;}
.brick-body .rw-head h1{font-size:1.15rem;}
.brick-body .panel{border-radius:12px;}
.brick-body .ph-c3{position:static;}
.brick-body .ph-tools{justify-content:flex-start;margin-bottom:0.6rem;}
.brick-body .ph-tools #ph-search{max-width:none;}
.brick-body .ph-sec{margin-top:0;padding-top:0;border-top:none;}
.brick-body #ph-est-panel{margin-top:0;}
.brick-body .ph-estbox{position:static;}
/* Together (Projects, TryZoom, My calendar) and every other two column page: the two columns are set by
   the viewport, which says nothing about how wide the brick is, so inside a brick they follow the brick. */
.brick-body .rw-cols{grid-template-columns:1fr;gap:0.8rem;}
@container brick (min-width:900px){ .brick-body .rw-cols{grid-template-columns:1.6fr 1fr;} }
/* Collaborate: the brick title already says what it is, so the page heading goes and the home or the open
   document fills the body edge to edge (flex column, min-height 0 all the way down, no scroll of its own). */
.brick[data-key="projects"] .brick-body{display:flex;flex-direction:column;min-height:0;overflow:hidden;}
.brick[data-key="projects"] #view-projects{flex:1;min-height:0;display:flex;flex-direction:column;}
/* 22 Sep 2026 (seams): min-height needs !important too: careers-admin.html gives #view-projects .tg-collab a
   420 px floor (an id selector, which beats this one), so the home and editor ran 73 px past the brick body. */
.brick[data-key="projects"] .tg-collab{flex:1;min-height:0!important;height:auto!important;max-width:none;padding:0!important;display:flex;flex-direction:column;}
.brick[data-key="projects"] .tg-collab>.rw-head{display:none;}
.brick[data-key="projects"] #tg-projects{flex:1;min-height:0;border:none!important;border-radius:0!important;}
.brick[data-key="teamchat"] .brick-body{display:flex;flex-direction:column;}
.brick[data-key="teamchat"] .rw-wrap{flex:1;display:flex;flex-direction:column;min-height:0;}
.brick[data-key="teamchat"] .tc-layout{flex:1;min-height:0;height:auto!important;margin-bottom:0;}
.brick[data-key="map"] .brick-body,.brick[data-key="map"] .wrap,.brick[data-key="map"] #map-panel{display:flex;flex-direction:column;min-height:0;}
.brick[data-key="map"] .wrap,.brick[data-key="map"] #map-panel{flex:1;}
.brick[data-key="map"] #crm-map{flex:1;min-height:200px;height:auto!important;}
.brick[data-key="map"] #map-resize{display:none;}
.brick[data-key="ph-map"] .brick-body{display:flex;flex-direction:column;}
.brick[data-key="ph-map"] #ph-map{flex:1;min-height:200px;height:auto!important;}
/* full screen for the TV: the top bar goes, the bricks bar stays */
body.ws-fs{--ws-top:0px;}
body.ws-fs .topbar{display:none;}
/* dark mode */
:root[data-theme="dark"] .ws-bar{background:var(--tc-bg);border-color:var(--tc-border);}
:root[data-theme="dark"] .ws-preset-btn{background:var(--tc-surface);border-color:var(--tc-border);color:var(--tc-text);}
:root[data-theme="dark"] .ws-menu{background:var(--tc-surface);border-color:var(--tc-border);}
:root[data-theme="dark"] .ws-menu .mi{color:var(--tc-text);}
:root[data-theme="dark"] .ws-empty b{color:var(--tc-text);}
:root[data-theme="dark"] .brick{background:var(--tc-surface);border-color:var(--tc-border);box-shadow:0 8px 24px rgba(0,0,0,0.35);}
:root[data-theme="dark"] .brick-head{background:var(--tc-surface-2);border-color:var(--tc-border);}
:root[data-theme="dark"] .brick-title{color:var(--tc-text);}
:root[data-theme="dark"] .brick-tools .bt:hover{color:var(--tc-text);}
:root[data-theme="dark"] .ws-bar .btn[aria-pressed="true"]{background:var(--tc-btn-solid);color:var(--tc-text);border-color:var(--tc-btn-solid);}
@media(max-width:760px){
  .ws-bar{padding:0.45rem 0.6rem;}
  .ws-preset-btn{max-width:52vw;}
  .brick{min-width:200px;}
  /* the toolbar wraps here, so the menus are pulled back onto the screen by placeMenu() in workspace.js */
  .ws-menu{min-width:0;width:min(320px,calc(100vw - 16px));}
  /* an open list runs down to the tab bar, so the floating light switch steps out of the way */
  body.ws-menu-open #tc-theme-toggle{display:none;}
}
