/* Departments: top capsule, phone tab bar and More, Overview pages, Home's Today and Company pulse (dept-nav.js, departments.js) */

/* Top capsule: every label on wide screens, only the current one in between, icons only on small laptops */
#deptNav a{padding:0 14px}
#deptNav a:focus-visible,.dept-bar a:focus-visible,.dept-bar button:focus-visible{outline:2px solid var(--orange);outline-offset:-2px}
@media (min-width:1181px) and (max-width:1679px){#deptNav a:not([aria-current="page"]) span{display:none}#deptNav a:not([aria-current="page"]){padding:0 13px}}
@media (min-width:900px) and (max-width:1180px){#deptNav a{padding:0 12px}.search input{width:0;padding:0}.search input:focus{width:140px}}

/* Phone: a tab bar at the bottom (Home, Sales, Finance, HR, More) */
.dept-bar{display:none}
@media (max-width:899px){
  .topbar #deptNav{display:none}
  .dept-bar{position:fixed;z-index:30;left:max(16px,env(safe-area-inset-left,0px));right:max(16px,env(safe-area-inset-right,0px));bottom:calc(14px + env(safe-area-inset-bottom,0px));display:flex;gap:2px;padding:6px;border-radius:999px}
  .dept-bar a,.dept-bar button{flex:1 1 0;min-width:0;flex-direction:column;justify-content:center;gap:2px;height:52px;padding:0 4px;font-size:10px;font-weight:600}
  .dept-bar span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ai-fab{bottom:calc(86px + env(safe-area-inset-bottom,0px))}
}
body.locked .dept-bar,body.loading .dept-bar{display:none}
.dept-more{position:fixed;z-index:46;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(82px + env(safe-area-inset-bottom,0px));width:min(320px,calc(100vw - 32px));padding:6px;border-radius:26px;display:flex;flex-direction:column;gap:2px}
.dept-more a{display:flex;align-items:center;gap:12px;min-height:52px;padding:8px 12px;border-radius:20px;color:var(--ink)}
.dept-more a:hover{background:var(--track)}
.dept-more a[aria-current="page"]>.ic:first-child{color:var(--orange)}
.dept-more a:focus-visible{outline:2px solid var(--orange);outline-offset:-2px}
.dept-more .row-main{min-width:0;flex:1}

/* Overview */
.dept-lead{display:flex;align-items:center;gap:14px;padding:14px 18px;border-radius:24px;margin-bottom:16px}
.dept-lead .row-main{min-width:0;flex:1}
.dept-lead .av-lg{width:44px;height:44px;font-size:16px}
.dept-avs{display:inline-flex;flex:none}
.dept-avs .av{width:34px;height:34px;font-size:13px;box-shadow:0 0 0 2px var(--bg)}
.dept-avs .av+.av{margin-left:-9px}
.dept-lead-edit{flex:none}
.dept-kpis{margin-bottom:8px}
a.metric{color:inherit;border-radius:inherit;transition:background .2s}
a.metric:hover{background:var(--track)}
a.metric:focus-visible{outline:2px solid var(--orange);outline-offset:-2px}
.dept-grid{margin-top:22px}
.dept-sec{margin-top:30px}
.dept-goal .goal-ring{flex:none}
.dept-goal .row-main,.dept-grid .row-main{min-width:0}
.dept-grid .row-title,.dept-grid .row-sub{overflow-wrap:anywhere}
.dept-grid .row-end{flex:none}
.dept-pages{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.dept-page{display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:24px;color:var(--ink);min-width:0}
.dept-page .row-main{min-width:0;flex:1}
.dept-page .row-sub{white-space:normal}
.dept-page:focus-visible,.dept-pulse-row:focus-visible,.dept-settings-row:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
.dept-page-ic{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex:none;background:var(--track);color:var(--orange)}
.dept-intro{margin:-12px 0 18px}

/* Home: Today and Company pulse */
.dept-today-wrap{margin:0 0 26px}
.dept-today{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.dept-today-col{min-width:0}
.dept-today-col .g-title{margin-top:0}
.dept-today .row-main{min-width:0}
.dept-today .row-title{overflow-wrap:anywhere}
.dept-more-row{justify-content:center;color:var(--orange-ink);font-weight:600}
.dept-pulse-row .row-main{min-width:0;flex:1}
.dept-pulse-n{display:flex;flex-direction:column;align-items:flex-end;text-align:right;min-width:0;max-width:45%}
.dept-pulse-n b{font-variant-numeric:tabular-nums;font-size:17px}
.dept-pulse-n span{font-size:12px;overflow-wrap:anywhere}
@media (max-width:899px){.dept-today{grid-template-columns:minmax(0,1fr)}}

/* Pages moved out of sheets */
.dept-cx{padding:4px 16px}
.dept-cx .cx{padding:0}
.aim-page{margin-top:4px}
.dept-ai-box{padding:16px 20px}
.dept-ai-text{line-height:1.5;overflow-wrap:anywhere}
.dept-rep-pick{max-width:260px;margin-bottom:18px}

/* Admin › Workspace › Departments */
.dept-edit{padding:4px 0}
.dept-erow{display:grid;grid-template-columns:38px minmax(0,1.3fr) minmax(0,1fr) auto;align-items:end;gap:10px;padding:12px 14px}
.dept-erow+.dept-erow{border-top:1px solid var(--hair)}
.dept-erow .dept-page-ic{align-self:center}
.dept-erow .field{margin:0}
.dept-move{display:flex;gap:2px;align-self:center}
.dept-up .ic{transform:rotate(180deg)}
.dept-move button:disabled{opacity:.35}
.dept-move button:focus-visible{outline:2px solid var(--orange);outline-offset:1px}
@media (max-width:640px){.dept-erow{grid-template-columns:38px minmax(0,1fr) auto}.dept-erow .field:nth-of-type(2){grid-column:2/3}.dept-erow .dept-move{grid-row:1/3;grid-column:3}}
.adm-matrix .switch[aria-checked="mixed"]{opacity:.75;box-shadow:inset 0 0 0 1.5px var(--orange)}
.dept-ai-box+.dept-intro{margin:10px 4px 0}
