@media (max-width: 1160px) {
  .docs-layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc { display: none; }
  .home, .api-page { grid-column: 2; }
  .home-hero { grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr); gap: 44px; }
}
@media (max-width: 900px) {
  .topbar { padding: 0 14px 0 6px; }
  .menu-button { display: block; }
  .docs-layout { display: block; }
  .sidebar {
    position: fixed;
    z-index: 90;
    top: var(--topbar);
    left: 0;
    width: min(310px, 88vw);
    transform: translateX(-105%);
    transition: transform 200ms var(--ease);
    box-shadow: 20px 0 60px rgba(10, 22, 16, 0.16);
    visibility: hidden;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  .nav-overlay {
    position: fixed;
    z-index: 80;
    inset: var(--topbar) 0 0;
    display: none;
    background: rgba(18, 30, 23, 0.34);
    backdrop-filter: blur(2px);
  }
  body.nav-open .nav-overlay { display: block; }
  .search-button { width: 44px; justify-content: center; }
  .search-button > span:not(.search-icon), .search-button kbd { display: none; }
  .guide { padding: 41px 30px 64px; }
  .home-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 58px; padding-bottom: 62px; }
  .answer-flow { max-width: 620px; }
  .home-section { padding-left: 30px; padding-right: 30px; }
  .home-callout { margin-left: 30px; margin-right: 30px; }
  .api-intro { padding-inline: 30px; }
}
@media (max-width: 700px) {
  .topbar-actions { gap: 4px; }
  .topbar-link { display: none; }
  .theme-toggle { min-width: 38px; width: 38px; padding: 0; justify-content: center; }
  .theme-toggle-copy { display: none; }
  .brand-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-area::before { margin-right: 6px; }
  .section-heading { flex-direction: column; gap: 10px; }
}
@media (max-width: 560px) {
  :root { --topbar: 58px; }
  .topbar { gap: 8px; }
  .brand { gap: 8px; font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-mark img { width: 28px; height: 28px; }
  .shortcut-mod { display: none; }
  .search-button, .theme-toggle { width: 38px; min-width: 38px; min-height: 36px; padding: 0; justify-content: center; }
  .guide { padding: 31px 19px 55px; }
  .guide-header { padding-top: 27px; }
  .guide-header h1 { font-size: 42px; line-height: 1.02; }
  .guide-header p { font-size: 16px; }
  .guide-body { font-size: 15px; }
  .guide-body h2 { font-size: 27px; }
  .guide-body table { display: block; overflow-x: auto; }
  .page-navigation { grid-template-columns: 1fr; }
  .home-hero { padding: 49px 19px 54px; }
  .home-hero h1 { font-size: 51px; }
  .hero-copy > p { font-size: 16px; }
  .answer-flow { box-shadow: 8px 8px 0 color-mix(in srgb, var(--accent) 4%, transparent); }
  .flow-head small { display: none; }
  .home-section { padding: 47px 19px; }
  .section-heading h2 { font-size: 31px; }
  .track-grid, .featured-grid { grid-template-columns: 1fr; }
  .track-card { min-height: 185px; }
  .home-callout { margin: 47px 19px; padding: 25px 20px; flex-direction: column; align-items: flex-start; }
  .home-callout h2 { font-size: 30px; }
  .callout-actions { width: 100%; min-width: 0; }
  .site-footer { margin-top: 28px; padding: 22px 19px; flex-direction: column; }
  .api-intro { padding: 32px 19px; flex-direction: column; }
  .api-intro nav { width: 100%; min-width: 0; }
  .search-dialog { width: calc(100% - 18px); max-height: calc(100vh - 20px); }
  .search-results { max-height: calc(100vh - 100px); }
  .not-found { padding: 30px 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media print {
  :root {
    --canvas: #fff;
    --surface: #fff;
    --surface-soft: #fff;
    --text-strong: #000;
    --text: #111;
    --text-muted: #333;
    --text-quiet: #555;
    --hairline: #ccc;
    --hairline-strong: #999;
  }
  .topbar, .sidebar, .toc, .page-navigation, .site-footer, .search-dialog { display: none !important; }
  .docs-layout { display: block; padding-top: 0; }
  .guide, .home, .api-page { max-width: none; padding: 0; }
  body::before { display: none; }
  a { color: #000; text-decoration: underline; }
  .code-frame { break-inside: avoid; }
}
