/* Footer presentation only. Document URLs, disclosure markup and controls stay native. */
.footer { padding-block: 44px 28px; }
.footer .footer-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  justify-content: normal;
  gap: 14px 40px;
}
.footer .footer-top > .brand { grid-column: 1; grid-row: 1; min-width: 0; }
.footer .footer-top > .brand img { width: 158px; max-width: 100%; height: auto; }
.footer .footer-resources { display: contents; }
.footer .footer-docs {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  font-size: .875rem;
}
.footer .footer-docs a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; line-height: 1.5; overflow-wrap: anywhere; max-width: 100%; }
.footer .footer-documentation { grid-column: 3; grid-row: 1 / span 2; min-width: 0; margin: 0; padding: 0; border: 0; }
.footer .footer-documentation > summary { display: flex; width: fit-content; max-width: 100%; min-height: 44px; font-size: .875rem; line-height: 1.5; }
.footer .footer-documentation > nav { margin-top: 10px; }
.footer .footer-documentation-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.footer .footer-documentation-list > li > a { padding-block: 8px; font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.footer .footer-documentation-list .sub-menu { margin-top: 2px; }
.footer .footer-documentation-list .sub-menu a { min-height: 44px; padding-block: 10px; font-size: .8125rem; }
.footer .footer-top > .back-top { grid-column: 1; grid-row: 2; justify-self: start; align-self: start; min-height: 44px; margin: 0; }
.footer .footer-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 18px 40px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  line-height: 1.65;
}
.footer .footer-meta > * { min-width: 0; overflow-wrap: anywhere; }
.footer .motion-toggle { justify-self: start; align-items: center; min-height: 44px; margin-top: -10px; margin-left: 0; text-align: left; line-height: 1.5; }
.footer .motion-toggle .icon { flex-shrink: 0; }
.footer .medical-notice { margin-top: 26px; font-size: 1.05rem; line-height: 1.6; letter-spacing: .035em; text-wrap: balance; }
.footer a:focus-visible, .footer button:focus-visible, .footer summary:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 4px; }
@media (max-width: 900px) {
  .footer .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
  .footer .footer-top > .brand { grid-column: 1 / -1; grid-row: 1; }
  .footer .footer-docs { grid-column: 1; grid-row: 2; }
  .footer .footer-documentation { grid-column: 2; grid-row: 2; }
  .footer .footer-top > .back-top { grid-column: 1 / -1; grid-row: 3; }
  .footer .footer-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
  .footer .motion-toggle { grid-column: 1 / -1; margin-top: 0; }
}
@media (max-width: 560px) {
  .footer { padding-top: 32px; }
  .footer .footer-top { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .footer .footer-docs { grid-column: 1; grid-row: 2; width: 100%; }
  .footer .footer-documentation { grid-column: 1; grid-row: 3; }
  .footer .footer-top > .back-top { grid-column: 1; grid-row: 4; }
  .footer .footer-meta { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 22px; padding-top: 20px; }
  .footer .medical-notice { text-align: left; margin-top: 20px; }
}
@media (max-width: 760px) {
  .footer { padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
}
/* Same white, grouped dropdown as the directions menu; opens upward near page end. */
@media (min-width: 901px) {
  .footer .footer-documentation { position: relative; }
  .footer .footer-documentation > nav {
    position: absolute;
    z-index: 26;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(920px, calc(100vw - 80px));
    max-height: var(--footer-dropdown-height, min(70vh, 640px));
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 58px #17382628;
  }
  .footer .footer-documentation[data-dropdown-side="below"] > nav { top: calc(100% + 8px); bottom: auto; }
  .footer .footer-documentation::after { position: absolute; right: 0; bottom: 100%; width: 100%; height: 12px; content: ""; pointer-events: none; }
  .footer .footer-documentation[open]::after { pointer-events: auto; }
  .footer .footer-documentation[data-dropdown-side="below"]::after { top: 100%; bottom: auto; }
  .footer .footer-documentation-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; }
  .footer .footer-documentation-list a { border-radius: 10px; padding-inline: 10px; }
  .footer .footer-documentation-list a:hover { background: var(--tint); color: var(--green-deep); text-decoration: none; }
}
