/* R106: one header layout for the existing Matter controls. Presentation only.
 * Explicit grid areas keep Guide out of Menu's target. The existing account
 * control retains its original owner and a reserved place on the second row.
 */
#shadow-matter-world {
  --shadow-header-top-r106: max(12px, env(safe-area-inset-top, 0px));
  --shadow-header-height-r106: calc(var(--shadow-header-top-r106) + 102px);
}
body[data-shadow-carrier="matter-world-r1"] #shadow-matter-world .mw-top {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-rows: 44px 44px;
  grid-template-areas: "brand matter guide menu" "truth truth . .";
  align-items: center;
  gap: 6px 12px;
  height: var(--shadow-header-height-r106);
  min-height: var(--shadow-header-height-r106);
  padding: var(--shadow-header-top-r106) 18px 8px;
  background: transparent;
  pointer-events: none;
}
#shadow-matter-world .mw-top > * { pointer-events: auto; }
#shadow-matter-world .mw-top > button { min-height: 44px; }
#shadow-matter-world .mw-top > .mw-brand { grid-area: brand; }
#shadow-matter-world .mw-top > .mw-matter-anchor { grid-area: matter; min-width: 0; }
#shadow-matter-world .mw-top > .mw-matter-anchor b { max-width: 100%; }
#shadow-matter-world .mw-top > .mw-truth {
  grid-area: truth;
  justify-self: start;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
#shadow-matter-world .mw-top > .sd-guide-launch {
  grid-area: guide;
  position: static;
  inset: auto;
  z-index: auto;
}
#shadow-matter-world .mw-top > #shadow-global-menu-trigger {
  grid-area: menu;
  position: static;
  margin: 0;
}
#shadow-matter-world .mw-top > .sd-guide-launch,
#shadow-matter-world .mw-top > #shadow-global-menu-trigger,
#shadow-matter-world .shadow-account-settings-open {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #d7b77f66;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #eee4d3;
  font: 500 13px/1.25 system-ui, sans-serif;
  white-space: nowrap;
  touch-action: manipulation;
}
#shadow-matter-world .shadow-account-settings-open {
  position: fixed;
  top: calc(var(--shadow-header-top-r106) + 50px);
  right: 18px;
  width: 166px;
  margin: 0;
}
body[data-shadow-carrier="matter-world-r1"] #shadow-matter-world.mw-world.ls-enabled .sd-depth {
  top: calc(var(--shadow-header-height-r106) + 8px);
}
@media (max-width: 600px) {
  body[data-shadow-carrier="matter-world-r1"] #shadow-matter-world .mw-top {
    grid-template-columns: 56px minmax(0, 1fr) 52px 88px;
    grid-template-areas: "brand matter matter menu" "guide truth . .";
    column-gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
  #shadow-matter-world .mw-top > .mw-brand { font-size: 17px; padding: 0; }
  #shadow-matter-world .mw-top > .mw-matter-anchor { padding: 0; }
  #shadow-matter-world .mw-top > .mw-matter-anchor small { font-size: 9px; }
  #shadow-matter-world .mw-top > .mw-matter-anchor b { font-size: 12px; }
  #shadow-matter-world .mw-top > .mw-truth { font-size: 10px; }
  #shadow-matter-world .mw-top > .sd-guide-launch { padding: 8px 5px; font-size: 12px; }
  #shadow-matter-world .mw-top > #shadow-global-menu-trigger { padding: 8px; font-size: 12px; }
  #shadow-matter-world .shadow-account-settings-open { right: 12px; width: 148px; font-size: 12px; }
}
