/* App navigation: compact geometry, quiet surfaces, one clear current location.
   Keep this after the product/material layers so navigation has a single finish. */
html body.product-active .topbar {
  background: var(--brand);
  border-bottom: 1px solid rgba(0,0,0,.08);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html body.product-active .topbar .dormy-header-brand {
  width: 132px;
  min-width: 132px;
  height: 44px;
  gap: 5px;
  padding: 0;
}
html body.product-active .topbar .dormy-mascot-slot {
  width: 32px;
  height: 34px;
  flex: 0 0 32px;
}
html body.product-active .topbar .dormy-brand-wordmark {
  width: 91px;
  height: 34px;
  flex: 0 0 91px;
  object-fit: contain;
}
html body.product-active .topbar .global-search {
  min-width: 0;
  max-width: 520px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fffaf6;
  box-shadow: none;
}
html body.product-active .topbar .global-search input {
  color: #292522;
  font-size: 13px;
  font-weight: 400;
}
html body.product-active .topbar .global-search .icon { width: 18px; height: 18px; color: #796d65; }
html body.product-active .topbar .global-search kbd { border-color: #e7e0d9; color: #796d65; font-size: 11px; }
html body.product-active .topbar .global-search:focus-within {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.3);
}
html body.product-active .topbar .top-actions { gap: 4px; }
html body.product-active .topbar .top-actions .icon-button {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  box-shadow: none;
}
html body.product-active .topbar .top-actions .icon { width: 20px; height: 20px; stroke-width: 1.75; }
html body.product-active .topbar .top-actions .icon-button:hover { background: rgba(255,255,255,.1); box-shadow: none; }
html body.product-active .topbar .avatar-button { width: 44px; height: 44px; }
html body.product-active .topbar .avatar-button .avatar { width: 30px; height: 30px; border-radius: 50%; }
html body.product-active .topbar :is(button,a):focus-visible { outline: 2px solid #fffaf6; outline-offset: 2px; }

html body.product-active .left-rail {
  padding: 20px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
html body.product-active .left-rail .nav-stack { gap: 4px; }
html body.product-active .left-rail .nav-link {
  position: relative;
  min-height: 44px;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: 500 14px/1.4 Inter,system-ui,sans-serif;
  letter-spacing: 0;
}
html body.product-active .left-rail .nav-link .icon { width: 20px; height: 20px; flex: 0 0 20px; stroke-width: 1.75; }
html body.product-active .left-rail .nav-link:hover { background: var(--bg); color: var(--ink); }
html body.product-active .left-rail .nav-link.active {
  background: color-mix(in srgb,var(--brand) 6%,var(--surface));
  color: var(--brand-strong);
  font-weight: 600;
  box-shadow: none;
}
html body.product-active .left-rail .nav-link.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: var(--brand);
}
html body.product-active .left-rail .nav-count { min-width: 20px; height: 20px; border-radius: 5px; font-size: 11px; font-weight: 500; }
html body.product-active .left-rail .rail-section { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
html body.product-active .left-rail .rail-heading { min-height: 44px; margin: 0 2px 4px 14px; }
html body.product-active .left-rail .rail-heading > span { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
html body.product-active .left-rail .rail-heading button { min-width: 44px; min-height: 44px; padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 500; border-radius: 6px; }
html body.product-active .left-rail .rail-heading button:hover { color: var(--brand-strong); background: var(--bg); }
html body.product-active .left-rail .circle-link { min-height: 52px; padding: 6px 14px; grid-template-columns: 28px minmax(0,1fr); gap: 10px; border-radius: 6px; }
html body.product-active .left-rail .circle-link :is(.circle-icon,.community-logo) { width: 28px; height: 28px; border-radius: 7px; }
html body.product-active .left-rail .circle-link strong { color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body.product-active .left-rail .circle-link small { color: var(--muted); font-size: 12px; line-height: 1.5; }
html body.product-active .left-rail .rail-empty { padding: 8px 14px; border: 0; border-radius: 0; background: none; }
html body.product-active .left-rail .rail-empty p { margin: 0 0 8px; font-size: 12px; line-height: 1.6; }
html body.product-active .left-rail .rail-empty button { min-height: 44px; padding: 0; font-size: 12px; font-weight: 500; }
html body.product-active .left-rail :is(button,select):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media(min-width:781px) {
  html body.product-active { --header: 64px; --left: 216px; }
  html body.product-active .topbar { grid-template-columns: var(--left) minmax(0,520px) auto; gap: 24px; padding-inline: 24px; }
  /* Anchor navigation to the viewport, not the centered reading column. */
  html body.product-active .app-shell,
  html body.product-active[data-active-view="home"] .app-shell:has(.home-page) { width: 100%; max-width: none; margin-inline: 0; padding-inline: 0; }
  /* Rooms retain their icon rail and use the remaining width for conversation. */
  html body.product-active .app-shell:has(.communities-page,.community-room,.messages-view) > .left-rail { padding: 20px 8px 20px 0; }
  html body.product-active .app-shell:has(.communities-page,.community-room,.messages-view) .nav-link { width: 44px; padding: 0; justify-content: center; }
}

@media(min-width:781px) and (max-width:1100px) {
  html body.product-active { --left: 188px; }
  html body.product-active .topbar { grid-template-columns: 156px minmax(0,1fr) auto; gap: 16px; padding-inline: 20px; }
}
@media(max-width:780px) {
  html body.product-active .left-rail { display: none; }
  html body.product-active .topbar .dormy-header-brand { width: 124px; min-width: 124px; }
  html body.product-active .topbar .dormy-brand-wordmark { width: 83px; flex-basis: 83px; }
  html body.product-active .topbar .top-actions { gap: 2px; }
  html body.product-active .topbar .global-search { height: 44px; max-width: none; }
  html body.product-active .topbar .global-search input { font-size: 16px; }
  html body.product-active .mobile-section-tabs {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  html body.product-active .mobile-section-tabs .mobile-section-link {
    min-height: 44px;
    padding-inline: 14px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
  }
  html body.product-active .mobile-section-tabs .mobile-section-link.active { color: var(--brand-strong); background: transparent; box-shadow: none; font-weight: 600; }
  html body.product-active .mobile-nav { background: var(--surface); border-top: 1px solid var(--line); box-shadow: none; }
  html body.product-active .mobile-nav .mobile-link { border-radius: 6px; background: transparent; box-shadow: none; color: var(--muted); }
  html body.product-active .mobile-nav .mobile-link.active { color: var(--brand-strong); background: transparent; box-shadow: none; }
  html body.product-active .mobile-nav .mobile-link .icon { width: 22px; height: 22px; stroke-width: 1.8; }
  html body.product-active .mobile-nav .mobile-link.active .icon { box-sizing: border-box; padding: 0; border-radius: 0; background: transparent; transform: none; stroke-width: 2; }
  html body.product-active .mobile-nav .mobile-link span { font-size: 11px; font-weight: 500; }
}
@media(prefers-reduced-motion:no-preference) {
  html body.product-active :is(.left-rail .nav-link,.left-rail .circle-link,.topbar .icon-button) { transition: color 140ms ease,background-color 140ms ease; }
}
