/* Shared by the static application and Rust-rendered public pages. */
.header-community {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  color: var(--muted);
}
.header-community:hover {
  color: var(--ink);
}
.workspace-topbar .header-community {
  margin-left: auto;
}
.workspace-topbar .account-link {
  margin-left: 0;
}
.public-topbar .header-community {
  margin-left: auto;
}
.public-account {
  margin-left: 0;
}
.site-footer {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  background: var(--header);
  color: var(--muted);
  font-size: 0.875rem;
}
.footer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  max-width: 1460px;
  margin: auto;
  padding: 2rem;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 650;
  min-height: 44px;
  text-decoration: none;
}
.footer-intro p {
  max-width: 38ch;
  margin: 0.7rem 0;
  line-height: 1.6;
}
.footer-affiliation {
  font-size: 0.8125rem;
}
.site-footer nav {
  order: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: start;
}
.site-footer h2 {
  font: 650 0.9375rem var(--font-body);
  color: var(--ink);
  margin: 0.65rem 0 0.4rem;
}
.site-footer nav a {
  white-space: normal;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}
.site-footer nav a:hover {
  color: var(--gold);
  text-decoration: underline;
}
.footer-bottom {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}
.site-footer .footer-bottom nav {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
}
.footer-bottom > span {
  font-size: 0.8125rem;
}
.public-tools {
  display: none;
}
@media (max-width: 960px) {
  .public-workspace > .public-rail {
    display: none;
  }
  .public-tools {
    display: block;
    padding: 0 1rem;
    margin: 0;
    border-bottom: 1px solid var(--line);
  }
  .public-tools summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--gold);
    gap: 0.5rem;
  }
  .public-tools summary::before {
    content: '+';
  }
  .public-tools[open] summary::before {
    content: '−';
  }
  .public-tools nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding-bottom: 1rem;
  }
  .public-tools .nav-group {
    display: flex;
    flex-direction: column;
  }
  .public-tools .nav-group a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem;
    text-decoration: none;
  }
  .public-tools a[aria-current='page'] {
    background: var(--selected);
    color: var(--gold);
  }
  .footer-shell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-intro {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .header-community > span {
    display: none;
  }
  .workspace-topbar .shell {
    gap: 0.35rem;
  }
  .public-topbar {
    gap: 0.6rem;
  }
  .public-tools nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .public-tools .nav-group:last-child {
    grid-column: 1/-1;
  }
  .footer-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.5rem 1rem;
    gap: 1rem;
  }
  .site-footer nav:last-of-type {
    grid-column: 1/-1;
  }
  .footer-bottom {
    display: block;
  }
  .site-footer .footer-bottom nav {
    margin-top: 0.5rem;
  }
}

.policy-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
}
.policy-directory section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.legal-page .policy-directory h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}
.policy-directory h2 a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.policy-directory p {
  margin: 0;
}
.prose.legal-page {
  max-width: 76ch;
}
.legal-page h2[id],
.legal-page h3[id] {
  scroll-margin-top: 6rem;
}
@media (max-width: 600px) {
  .policy-directory {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 960px) {
  .workspace-shell:not(.enhanced) > .tool-rail {
    display: none;
  }
}

/* One native preference control shared by both renderers. Without JS, follow the OS. */
.theme-control {
  display: none;
  margin-left: auto;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font: 400 0.875rem var(--font-body);
}
html[data-theme] .theme-control {
  display: flex;
}
.theme-control select {
  width: auto;
  min-height: 44px;
  padding: 0.4rem 0.5rem;
  font: inherit;
  background: var(--input);
  color: var(--ink);
  border: 1px solid var(--control-line);
  border-radius: 5px;
}
.workspace-topbar .header-community,
.public-topbar .header-community {
  margin-left: 0;
}
@media (max-width: 600px) {
  .theme-control > span {
    display: none;
  }
  .theme-control select {
    max-width: 5.6rem;
  }
  .workspace-topbar .shell,
  .public-topbar {
    flex-wrap: wrap;
  }
  .workspace-topbar .brand-note {
    display: none;
  }
  .workspace-topbar .brand {
    font-size: 0.9rem;
  }
  .workspace-topbar .brand img {
    width: 24px;
    height: 24px;
  }
}
