/* v45 shared navigation. Keep this last in the stylesheet load order. */
:root {
  --nav-surface: #fff;
  --nav-soft: #f2f7fc;
  --nav-focus: #1479bd;
}
[data-theme="dark"] {
  --nav-surface: #172231;
  --nav-soft: #202f40;
  --nav-focus: #81caff;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 10000;
  padding: 12px;
  background: var(--nav-surface);
}
.skip-link:focus {
  top: 10px;
}
:where(a, button, input, select, summary):focus-visible {
  outline: 3px solid var(--nav-focus);
  outline-offset: 3px;
}
header .top {
  display: flex;
  width: 100%;
  overflow: visible;
  gap: 6px;
  padding: 8px 24px;
}
header .top a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 20px;
  white-space: normal;
  text-align: center;
}
header .top a.active {
  background: var(--nav-soft);
  box-shadow: inset 0 -3px var(--nav-focus);
  font-weight: 700;
}
.layout,
.layout:has(.teamview),
.layout:has(.hubside),
.layout:has(.chatworkspace) {
  max-width: none;
  width: 100%;
  grid-template-columns: 240px minmax(0, 1fr);
  margin: 0;
}
.layout > aside {
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--nav-surface);
  overflow: visible;
  max-height: none;
}
.layout main,
.layout:has(.teamview) main {
  padding: 0 24px 24px;
  min-width: 0;
}
.pagebar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.pagebar h1 {
  margin: 0;
  font-size: calc(26px * var(--wif-text-scale, 1));
  line-height: 1.25;
}
.page-context {
  margin: 0 0 6px;
  font-size: calc(13px * var(--wif-text-scale, 1));
  color: var(--muted);
}
.page-description {
  margin: 8px 0 0;
  max-width: 75ch;
  color: var(--muted);
}
.pagebar .titlehelptoggle {
  flex-shrink: 0;
  margin: 0;
  font-size: 14px;
}
.side a,
.teamrightmenu a,
.teamnames .teamrow {
  min-height: 44px;
  padding: 12px;
  font-size: calc(14px * var(--wif-text-scale, 1));
  border-radius: 8px;
}
.sidefoot {
  display: grid !important;
  gap: 12px;
  padding: 24px 10px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.sidefoot a {
  padding: 8px 0;
}
.teamview {
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  min-height: 0;
}
.teamrightmenu {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--nav-surface);
  padding: 16px 10px;
}
.team-tools-disclosure > summary {
  display: none;
}
.teamviewbody {
  min-width: 0;
}
.layout:has(.hubside) .chatworkspace {
  min-height: 0;
}
.section-menu-button {
  display: none;
}
.btn,
button:not(.toggle),
select {
  min-height: 44px;
}
#mobileNav {
  display: none !important;
}
body {
  padding-bottom: 0;
}
@media (max-width: 760px) {
  header {
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .brandrow {
    padding: 10px 14px;
  }
  .username,
  .account .avatar {
    display: none;
  }
  header .top {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px 10px 8px;
    overflow: visible;
  }
  header .top a {
    font-size: calc(13px * var(--wif-text-scale, 1));
    padding: 8px 4px;
    min-width: 0;
  }
  .layout,
  .layout:has(.teamview),
  .layout:has(.hubside) {
    display: flex;
    flex-direction: column;
  }
  .layout > aside {
    display: none;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }
  .layout.groups-open > aside {
    display: block;
  }
  .layout main,
  .layout:has(.teamview) main {
    width: 100%;
    padding: 0 14px 20px;
  }
  .pagebar {
    align-items: flex-start;
    gap: 12px;
    padding: 18px 0;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .pagebar h1 {
    font-size: calc(23px * var(--wif-text-scale, 1));
  }
  .pagebar .titlehelptoggle {
    font-size: 13px;
  }
  .section-menu-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--nav-surface);
    font: inherit;
  }
  .teamview {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .team-tools-disclosure {
    order: -1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--nav-surface);
  }
  .team-tools-disclosure > summary {
    display: list-item;
    padding: 12px;
    cursor: pointer;
    min-height: 44px;
  }
  .team-tools-disclosure:not([open]) > .teamrightmenu {
    display: none;
  }
  .teamrightmenu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    gap: 4px;
  }
  .teamrightmenu h2 {
    grid-column: 1 / -1;
  }
  .teamrightmenu a {
    min-width: 0;
    white-space: normal;
  }
  .layout:has(.teamview) .teamviewbody > .card,
  .layout:has(.teamview) .teamviewbody > .wizardsteps {
    margin: 12px 0;
  }
}
.more-start-options {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  margin-bottom: 24px;
}
.more-start-options > summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
}
@media (max-width: 760px) {
  #sectionSidebar .side {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  #sectionSidebar .side a {
    white-space: normal;
  }
  #sectionSidebar .label {
    display: block;
  }
  .brand {
    gap: 5px;
  }
  .brand img:first-child {
    width: 42px;
  }
  .brand img:last-child {
    width: 100px;
  }
  .account select {
    max-width: 128px;
  }
  .welcomegrid {
    grid-template-columns: 1fr;
  }
}

/* v53: one existing header per page, with help on its right. */
.inline-page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.inline-page-heading>h1,.inline-page-heading>h2 { margin:0; }
.page-help-host>.titlehelptoggle { margin-left:auto; flex-shrink:0; white-space:nowrap; }
.chatheading.page-help-host { flex-wrap:wrap; }
.chatheading.page-help-host>.titlehelptoggle { margin-left:auto; }
.page-focus-label { position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
@media(max-width:600px){.inline-page-heading,.heading.page-help-host{flex-wrap:wrap;gap:10px}.page-help-host>.titlehelptoggle{font-size:12px}}

/* v54: every route uses the same title/help row. No duplicate page heading. */
#main .unified-page-header { width:100%;box-sizing:border-box;margin:0 0 16px;padding:16px 20px;background:transparent; }
#main .unified-page-title-row { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px 20px;width:100%; }
#main .unified-page-title { display:block!important;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;font-size:calc(24px * var(--wif-text-scale,1))!important;font-weight:700!important;line-height:1.3!important;letter-spacing:normal!important;text-align:left!important;margin:0!important;padding:0!important;min-width:0;overflow-wrap:break-word; }
#main .unified-page-title-row>.titlehelptoggle { display:inline-flex!important;align-items:center;justify-self:end;align-self:center;gap:8px;position:static!important;float:none!important;margin:0!important;padding:0!important;white-space:nowrap;font:400 13px/1.3 system-ui!important; }
#main .unified-page-tools { display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:12px; }
#main .unified-page-tools:empty { display:none; }
#main .unified-page-tools p { margin:0; }
#main .unified-page-tools .chatidentity { flex:1;min-width:0; }
#main .unified-page-tools .teamavatar { flex-shrink:0; }
@media(max-width:600px){
 #main .unified-page-header { padding:12px; }
 #main .unified-page-title-row { gap:10px; }
 #main .unified-page-title-row>.titlehelptoggle { gap:5px;font-size:12px!important; }
}
