:root{color-scheme:light;--bg:#f5f5f5;--panel:#fff;--sidebar:#fafafa;--text:#242424;--muted:#616161;--line:#e0e0e0;--accent:#5b5fc7;--brand-text:#3e429a;--soft:#e8e9f8;--hover:#f0f0f0;--error:#a4262c;font-family:"Segoe UI",system-ui,"Apple SD Gothic Neo",sans-serif;color:var(--text);background:var(--bg)}
:root[data-theme=dark]{color-scheme:dark;--bg:#1f1f1f;--panel:#292929;--sidebar:#242424;--text:#f5f5f5;--muted:#c7c7c7;--line:#454545;--accent:#9698f5;--brand-text:#b6b8ff;--soft:#34365d;--hover:#363636;--error:#ff99a4}
:root[data-theme=contrast]{color-scheme:dark;--bg:#000;--panel:#000;--sidebar:#000;--text:#fff;--muted:#fff;--line:#fff;--accent:#ff0;--brand-text:#ff0;--soft:#1f1f1f;--hover:#303030;--error:#ff99a4}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:4px;padding:7px 11px;background:var(--panel);color:var(--text);font-size:13px}button:disabled{opacity:.55;cursor:default}button:hover:not(:disabled){background:var(--hover)}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}[hidden]{display:none!important}
.shell{height:100vh;height:100dvh;display:flex;flex-direction:column;padding:8px 10px;gap:8px}.panelhead,.profile-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.muted,.status{color:var(--muted);font-size:12px}.toolbar-button{white-space:nowrap}.toolbar-button span{color:var(--brand-text);font-size:16px;line-height:1;margin-right:2px}.notice{background:var(--soft);border-radius:6px;padding:10px 14px;font-size:13px}
.filters{display:grid;grid-template-columns:minmax(0,1fr) 100px auto;gap:8px;align-items:end;flex:none}.search,.employment-filter{display:block;font-size:12px;font-weight:600}.search input,.employment-filter select{display:block;width:100%;height:36px;padding:0 10px;margin-top:5px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text);font-size:13px}.search input:focus,.employment-filter select:focus{border-bottom:2px solid var(--accent)}.toolbar-button{height:36px}.status{margin:0;padding:1px 0}.status:empty{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0}.status[data-error=yes]{color:var(--error)}
.layout{display:grid;grid-template-columns:minmax(238px, min(28%,320px)) minmax(0,1fr);flex:1;min-height:0;border:1px solid var(--line);border-radius:7px;background:var(--panel);overflow:hidden}.panel{min-width:0;min-height:0;display:flex;flex-direction:column}.panel:first-child{border-right:1px solid var(--line);background:var(--sidebar)}.panelhead{flex:none;min-height:43px;padding:6px 12px;border-bottom:1px solid var(--line)}h2{font-size:15px;margin:0;font-weight:650}.panelhead p{margin:4px 0 0}.quiet{border-color:transparent;background:transparent;color:var(--brand-text);padding:5px 7px}.children{font-size:12px;white-space:nowrap;color:var(--muted);display:flex;align-items:center;gap:5px}.children input{accent-color:var(--accent)}
.tree,#people{flex:1;min-height:0;overflow:auto;padding:7px 8px;margin:0}.tree details{margin:1px 0}.branch{padding-left:12px;margin-left:5px;border-left:1px solid var(--line)}.tree summary{cursor:pointer;padding:1px 1px;color:var(--muted)}.tree button{max-width:calc(100% - 18px);padding:7px;border:0;text-align:left;background:transparent;overflow-wrap:anywhere}.tree button.org-match{background:var(--soft);color:var(--brand-text);font-weight:700}.tree button[aria-pressed=true]{background:var(--soft);color:var(--brand-text);font-weight:700;box-shadow:inset 3px 0 var(--accent)}.tree .count{font-size:11px;color:var(--muted);margin-left:7px;white-space:nowrap}.leaf{margin-left:13px}
#people{list-style:none;padding:4px 12px}.person{cursor:pointer;display:flex;gap:5px;align-items:center;border-bottom:1px solid var(--line);padding:3px 0}.person:last-child{border:0}.person-name{border:0;background:transparent;text-align:left;flex:1;display:flex;gap:10px;align-items:center;min-width:0;padding:6px}.person-copy{min-width:0}.person-copy span{display:block;overflow-wrap:anywhere}.person-copy>span:first-child{font-weight:650}.avatar{display:grid;place-items:center;width:36px;height:36px;background:var(--soft);color:var(--brand-text);border-radius:50%;font-size:14px;font-weight:700;flex:none}.avatar-photo{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}.chat{font-size:12px;padding:6px 8px;white-space:nowrap}.chat-action:not(:disabled){color:var(--brand-text)}.empty,.more-people{padding:10px 14px;color:var(--muted);font-size:13px}.more-people{text-align:center}.more-people button{color:var(--brand-text)}
dialog{border:1px solid var(--line);border-radius:9px;padding:18px;background:var(--panel);color:var(--text);width:min(440px,calc(100% - 28px));box-shadow:0 14px 45px #0004}dialog::backdrop{background:#0006}.profile-top{justify-content:flex-start}.profile-top button{margin-left:auto;align-self:flex-start}.profile-top p{margin:4px 0}.profile-top .avatar{width:52px;height:52px}dl{display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;padding:14px 0 8px;font-size:13px;border-top:1px solid var(--line)}dt{color:var(--muted)}dd{margin:0;overflow-wrap:anywhere}.primary{background:var(--soft);color:var(--brand-text);font-weight:650}
@media(max-width:660px){.shell{padding:6px;gap:6px}.layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,2fr)}.panel:first-child{border-right:0;border-bottom:1px solid var(--line)}.panelhead{padding:6px 8px}.person{gap:3px}.avatar{width:32px;height:32px}.filters{grid-template-columns:minmax(0,1fr) 68px auto;gap:5px}.toolbar-button{padding:5px 6px}.toolbar-button span{display:none}}

.person{content-visibility:auto;contain-intrinsic-size:auto 52px}

.welcome{flex:0 1 auto;max-height:44%;overflow:auto;padding:4px 8px 8px}
.welcome-banner{
  --welcome-title:var(--text);--welcome-muted:var(--muted);--welcome-text-inset:4px;
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title art" "person art" "note pages";
  align-items:center;column-gap:7px;row-gap:6px;padding:12px;border:1px solid var(--line);border-radius:14px;
  background:radial-gradient(ellipse at 100% 95%,#e9e7fb 0%,transparent 62%),var(--panel);
  box-shadow:inset 0 1px 0 #ffffff50,0 2px 5px #24234b0d;color:var(--welcome-title)
}
:root[data-theme=dark] .welcome-banner{background:radial-gradient(ellipse at 100% 95%,#37354b 0%,transparent 68%),#272728;box-shadow:inset 0 1px 0 #ffffff12,0 2px 5px #0003}
:root[data-theme=contrast] .welcome-banner{background:var(--panel);box-shadow:none}
.welcome-copy{grid-area:person;min-width:0;padding-inline-start:var(--welcome-text-inset)}
.welcome h2{grid-area:title;margin:0;padding-inline-start:var(--welcome-text-inset);font-size:15px;line-height:1.3;font-weight:700;letter-spacing:-.02em;word-break:keep-all;color:var(--brand-text)}
.welcome .muted{color:var(--welcome-muted)}
.welcome-name-line{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 5px}
#welcome-job-title{font-size:12px;font-weight:600;color:var(--welcome-muted);overflow-wrap:anywhere}
#welcome-name{display:block;font-size:21px;line-height:1.22;letter-spacing:.045em;font-weight:750;color:var(--welcome-title);overflow-wrap:anywhere}
#welcome-department{display:block;margin-bottom:4px;font-size:11px;line-height:1.35;color:var(--welcome-muted);overflow-wrap:anywhere}
#welcome-department:empty{display:none}
.welcome-note{grid-area:note;align-self:center;margin:0;padding-inline-start:var(--welcome-text-inset);font-size:11px;line-height:1.35;word-break:keep-all;color:var(--welcome-muted)}
.welcome-note span{font-weight:600}
.welcome-controls{grid-area:pages;align-self:center;justify-self:end;display:flex;align-items:center;gap:3px;background:transparent}
.welcome-controls button{width:23px;height:23px;padding:0;line-height:1;font-size:16px;border-radius:4px;border:1px solid transparent;background:transparent;color:var(--welcome-title)}
.welcome-controls button:hover:not(:disabled){background:var(--hover);color:var(--brand-text)}.welcome-controls button:focus-visible{outline-color:var(--accent)}
.welcome-empty{font-size:11px;margin:0}
:root[data-theme=contrast] .welcome-controls button{border-color:var(--line);background:transparent}
.popper-burst{transform-box:view-box;transform-origin:51% 57%}
.popper-body{transform-box:view-box;transform-origin:22% 84%}
.welcome-art{grid-area:art;width:clamp(58px,6.5vw,77px);height:auto;justify-self:end;filter:drop-shadow(0 3px 4px #29234c36);pointer-events:none}
@media(max-width:660px){.welcome{padding:3px 6px 6px;max-height:63%}.welcome-banner{padding:8px 10px}.welcome-art{width:clamp(54px,16vw,70px)}}

.people-controls{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;column-gap:10px;row-gap:4px;flex:none}.people-controls select{height:29px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--text);font-size:12px;padding-inline:6px}.people .panelhead>div:first-child{min-width:0;overflow-wrap:anywhere}
@media(max-width:410px){.people-controls{flex-direction:column-reverse;align-items:flex-end}}

/* Display modes, profile pane and photo zoom. */
.view-switch{display:flex;gap:4px;align-self:flex-start;padding:2px;border:1px solid var(--line);background:var(--panel);border-radius:6px}
.view-switch button{border-color:transparent;padding:5px 13px}
.view-switch button[aria-pressed=true]{background:var(--soft);color:var(--brand-text);font-weight:650}
.layout.chart-mode{grid-template-columns:minmax(0,1fr)}
.layout.with-profile{grid-template-columns:minmax(192px,min(25%,280px)) minmax(0,1fr) minmax(252px,min(30%,328px))}
.layout.chart-mode.with-profile{grid-template-columns:minmax(0,1fr) minmax(252px,min(30%,328px))}
.profile-panel{display:flex;flex-direction:column;min-width:0;min-height:0;border-left:1px solid var(--line);background:var(--panel)}
.profile-content{overflow:auto;min-height:0;padding:16px 15px}
.profile-top{margin-bottom:13px}
.profile-top .profile-avatar-button{padding:0;margin:0;align-self:center;border:0;opacity:1}
.profile-top .profile-avatar-button:not(:disabled){cursor:zoom-in}
.profile-top #profile-title{overflow-wrap:anywhere}
.profile-panel dl{grid-template-columns:70px minmax(0,1fr);margin:0 0 10px}
.profile-actions{display:flex;gap:6px;flex-wrap:wrap}
.profile-mail{color:var(--brand-text);text-underline-offset:2px}
.photo-viewer{width:fit-content;max-width:calc(100% - 24px);padding:0 0 12px}
.photo-viewer .panelhead{contain:inline-size;min-width:144px}
.photo-viewer img{width:auto;height:auto;max-width:min(560px,calc(100vw - 52px));max-height:76vh;object-fit:contain;display:block;margin:12px 10px 0}
.avatar{position:relative}
.presence-badge{position:absolute;top:-2px;right:-3px;z-index:1;width:15px;height:15px;display:grid;place-items:center;border:1px solid var(--panel);border-radius:50%;background:var(--presence-color);color:#fff;line-height:1}
.presence-badge svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.presence-available{--presence-color:#13a10e}.presence-away{--presence-color:#eaa300;color:#242424}.presence-busy,.presence-dnd{--presence-color:#d13438}.presence-offline{--presence-color:#616161;background:var(--panel);color:var(--presence-color);box-shadow:inset 0 0 0 1.4px var(--presence-color)}
:root[data-theme=dark] .presence-offline{--presence-color:#adadad}
:root[data-theme=contrast] .presence-badge{outline:1px solid CanvasText}
.profile-avatar-button .presence-badge{width:17px;height:17px}
@media(max-width:850px) and (min-width:661px){
  .layout.with-profile{grid-template-columns:minmax(156px,25%) minmax(0,1fr) minmax(216px,31%)}
  .profile-content{padding:12px 9px}
}
@media(max-width:660px){
  .layout.with-profile{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(64px,.62fr) minmax(95px,1fr) minmax(145px,1.18fr)}
  .layout.chart-mode{grid-template-rows:minmax(0,1fr)}
  .layout.chart-mode.with-profile{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(95px,1fr) minmax(145px,.9fr)}
  .profile-panel{border-left:0;border-top:1px solid var(--line)}
  .profile-content{padding:10px}
}
.welcome-banner{position:relative}
.welcome-close{position:absolute;z-index:1;top:3px;right:4px;min-width:24px;height:24px;padding:0;font-size:17px;line-height:1;color:var(--welcome-muted)}
.welcome-restore{margin:3px 8px 7px;align-self:flex-start;font-size:12px}

/* On narrow Teams tabs, the card has its own row instead of squeezing the org tree. */
@media(max-width:660px){
  .layout:not(.chart-mode){
    grid-template-rows:auto minmax(88px,.7fr) minmax(120px,1.4fr) auto;
    grid-template-areas:"org-heading" "org-tree" "members" "welcome";
    overflow:auto;
  }
  .layout:not(.chart-mode).with-profile{
    grid-template-rows:auto minmax(64px,.6fr) minmax(96px,1fr) minmax(135px,1.2fr);
    grid-template-areas:"org-heading" "org-tree" "members" "profile";
  }
  .layout:not(.chart-mode)>.panel:first-child{display:contents}
  .layout:not(.chart-mode)>.panel:first-child>.panelhead{grid-area:org-heading;background:var(--sidebar)}
  .layout:not(.chart-mode) #tree{grid-area:org-tree;background:var(--sidebar);border-bottom:1px solid var(--line)}
  .layout:not(.chart-mode) #people-panel{grid-area:members}
  .layout:not(.chart-mode) #profile{grid-area:profile}
  .layout:not(.chart-mode) .welcome,
  .layout:not(.chart-mode) .welcome-restore{grid-area:welcome}
  .layout:not(.chart-mode) .welcome{max-height:none;overflow:visible;border-top:1px solid var(--line);padding:6px}
  .layout:not(.chart-mode) .welcome-banner{padding:8px 10px;row-gap:4px}
  .layout:not(.chart-mode) .welcome-art{width:clamp(44px,12vw,55px);margin-inline-end:15px}
  .layout:not(.chart-mode).with-profile :is(.welcome,.welcome-restore){display:none}
  .people-controls{max-width:52%;min-width:0}
  .people-controls select{max-width:100%}
}

.favorite-star{flex:none;min-width:30px;min-height:30px;padding:2px 4px;font-size:21px;line-height:1;color:var(--muted)}
.favorite-star[aria-pressed=true]{color:#946200}
:root[data-theme=dark] .favorite-star[aria-pressed=true]{color:#ffcc66}
:root[data-theme=contrast] .favorite-star[aria-pressed=true]{color:Highlight}
.profile-header-actions{display:flex;align-items:center;gap:5px}
.layout.favorites-mode{grid-template-columns:minmax(0,1fr)}
.layout.favorites-mode.with-profile{grid-template-columns:minmax(0,1fr) minmax(252px,min(30%,328px))}
@media(max-width:660px){
  .layout:not(.chart-mode).favorites-mode{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);grid-template-areas:"members"}
  .layout:not(.chart-mode).favorites-mode.with-profile{grid-template-rows:minmax(96px,1fr) minmax(135px,1.2fr);grid-template-areas:"members" "profile"}
  .favorite-star{min-width:32px;min-height:34px}
}
.contact-options summary{display:list-item;cursor:pointer}
.contact-actions{display:flex;gap:8px;margin-top:7px;flex-wrap:wrap}
.contact-actions a{display:inline-flex;align-items:center;padding:5px 9px;border:1px solid var(--line);border-radius:4px;text-decoration:none}
.contact-actions a:hover{background:var(--hover)}

#profile-back,.mobile-photo{display:none}
@media(max-width:660px){
  .mobile-detail>.filters,.mobile-detail>.view-switch{display:none}
  .mobile-detail>.layout.with-profile{display:flex;flex-direction:column;overflow:hidden}
  .mobile-detail>.layout.with-profile>.panel{display:none}
  .mobile-detail #profile{display:flex;min-height:0;flex:1;border:0}
  .mobile-detail #profile>.panelhead{min-height:54px}
  #profile-back{display:inline-flex;align-items:center;white-space:nowrap}
  #profile-close{display:none}
  #profile-back,#profile-star,#mobile-photo-back{min-height:44px;padding-inline:10px}
  .mobile-detail .profile-content{flex:1;padding:16px;overscroll-behavior:contain}
  .mobile-detail .profile-actions button,.mobile-detail .contact-actions a{min-height:44px}
  #profile.showing-photo>.profile-panel-heading,#profile.showing-photo>.profile-content{display:none}
  .mobile-photo:not([hidden]){display:flex;flex:1;min-height:0;flex-direction:column}
  .mobile-photo>.panelhead{justify-content:flex-start}
  .mobile-photo h2{overflow-wrap:anywhere}
  .mobile-photo-content{flex:1;min-height:0;display:grid;place-items:center;padding:10px;overflow:auto}
  .mobile-photo-content img{display:block;max-width:100%;max-height:min(74dvh,100%);width:auto;height:auto;object-fit:contain}
}
@media(max-width:660px){
  .search input,.employment-filter select,.people-controls select{font-size:16px}
  .search input{min-width:0}
  .mobile-photo-content{grid-template-rows:minmax(0,1fr)}
}
@media(max-width:660px){
  html,body,.shell,.layout,#tree,#people,#org-chart,.profile-content,.mobile-photo-content{touch-action:pan-x pan-y}
}

.mobile-org-nav{display:none}
@media(max-width:660px){
  .layout.browse-org:not(.with-profile){
    grid-template-rows:auto minmax(0,1fr) auto;
    grid-template-areas:"org-heading" "org-tree" "welcome";
  }
  .layout.browse-org:not(.with-profile)>#people-panel{display:none}
  .layout.browse-members:not(.with-profile){
    grid-template-rows:minmax(0,1fr);
    grid-template-areas:"members";
  }
  .layout.browse-members:not(.with-profile)>.panel:first-child{display:none}
  .layout.browse-members:not(.with-profile) .mobile-org-nav{display:flex;border-bottom:1px solid var(--line);padding-inline:5px}
  #mobile-org-back{min-height:44px;padding-inline:10px}
}

@media(max-width:660px){
  .mobile-inline-tree{padding:3px 8px 8px;scroll-padding-block:4px}
  .mobile-inline-tree .mobile-branch{margin:0}
  .mobile-inline-tree .mobile-org-row,.mobile-inline-tree .mobile-worker{
    width:100%;max-width:none;display:flex;align-items:center;min-height:44px;gap:8px;padding:6px 5px;border:0;border-radius:4px;text-align:left;
  }
  .mobile-inline-tree summary::-webkit-details-marker{display:none}
  .mobile-inline-tree .mobile-org-row{color:var(--text);font-size:14px;font-weight:650}
  .mobile-inline-tree .mobile-org-row.current-org{background:var(--soft);color:var(--brand-text)}
  .mobile-inline-tree .count{margin-left:auto;color:var(--brand-text);font-size:12px}
  .mobile-org-name,.mobile-worker-name{min-width:0;overflow-wrap:anywhere}
  .mobile-org-mark{width:17px;height:15px;border:1px solid currentColor;border-radius:3px;display:inline-grid;place-items:center;flex:none;line-height:1;color:var(--brand-text)}
  .mobile-org-mark::before{content:"+"}
  .mobile-branch[open]>.mobile-org-row .mobile-org-mark::before{content:"−"}
  .mobile-org-children{margin-inline-start:8px;padding-inline-start:7px;border-inline-start:1px solid var(--line)}
  .mobile-inline-tree .mobile-worker{position:relative;padding-inline-start:5px}
  .mobile-inline-tree .mobile-worker .avatar{width:23px;height:23px;font-size:10px}
  .mobile-inline-tree .mobile-worker .presence-badge{width:12px;height:12px}
  .mobile-worker .muted{min-width:0;overflow-wrap:anywhere}
  .mobile-inline-tree .mobile-worker:nth-child(odd){background:var(--panel)}
}
