/* Mobile repair of existing specimens. Reuses the shell's spacing/target tokens;
   intrinsic min-width and grid mechanics do not introduce a visual pattern. */
.foundation-editorial-hero-copy { min-width: 0; overflow-wrap: anywhere; }
body[data-route="foundation-color"] .foundation-editorial-hero { grid-template-columns: minmax(0,1fr); }
.lds-public-token-table-wrap, .lds-token-ledger-table-wrap { min-width: 0; overflow-x: auto; }
.tabspec { max-width: 100%; overflow-x: auto; }
.tabspec-tab { flex-shrink: 0; }
@media (max-width: 1199px) {
  body[data-lds-shell] .app-nav { position: sticky; top: 0; z-index:var(--lds-z-sticky); padding: var(--lds-space-2) var(--lds-space-4); background: var(--color-bg-panel); }
  body[data-lds-shell] .nav-rail-card { max-height: calc(100svh - var(--lds-space-4)); overflow-y: auto; }
  body[data-lds-shell].documentation-nav-collapsed .nav-rail-head { justify-content: flex-start; }
  body[data-lds-shell] .nav-rail-toggle { min-width: var(--lds-touch-target-min); min-height: var(--lds-touch-target-min); }
  body[data-lds-shell] .nav-rail-toggle::after { content: none; }
}
@media (max-width: 600px) {
  body[data-route="foundation-motion"] :is(.motion-scene-stage,.motion-compact-lab,.motion-compact-grid,.motion-spatial-panel,.motion-local-play-grid) { min-width: 0; max-width: 100%; grid-template-columns: minmax(0,1fr) !important; }
  body[data-route="foundation-motion"] :is(.motion-scene-stage,.motion-compact-card:nth-child(n),.motion-spatial-panel) { padding: var(--lds-space-4) !important; }
  body[data-route="foundation-motion"] :is(.motion-spatial-actions,.motion-state-control-lockup) { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  body[data-route="foundation-motion"] :is(.motion-compact-result,.motion-validation-result) { grid-template-columns: minmax(0,1fr) !important; }
  body[data-route="foundation-motion"] .motion-compact-card > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
/* Decorative hero light stays inside its section; text remains in normal flow. */
.foundation-editorial-hero { overflow: clip; }
@media (max-width:1199px) {
  .tooltip-state-surface { grid-template-columns: minmax(0,1fr) !important; }
}
/* The color route predates the shared shell; honor its available content rail. */
body[data-route="foundation-color"] .color-foundation-hero { width: 100%; min-width: 0; max-width: 100%; }
body[data-route="foundation-color"] .color-page-nav-rail .section-nav-track { min-width: 0; max-width: 100%; overflow-x: auto; }
body[data-lds-shell] .foundation-editorial-hero::before { inset: 0 !important; }
@media (max-width:1199px) {
  body[data-lds-shell].documentation-nav-collapsed .nav-tree { display:none !important; }
}

/* A tablet cannot share its width with the desktop navigation rail. */
@media (max-width:1199px) {
 body[data-lds-shell] { --color-page-sidebar-current-width:0px !important; }
 body[data-lds-shell] .app-shell { grid-template-columns:minmax(0,1fr) !important; }
 body[data-lds-shell] .app-nav { width:100%; height:auto; min-height:0; }
 body[data-lds-shell] .nav-rail-card { width:100%; min-height:0; }
 body[data-lds-shell] .app-main { min-width:0; }
}
@media (max-width:1199px) {
 body[data-lds-shell] .nav-rail-head { position:relative!important; inset:auto!important; width:auto!important; height:auto!important; padding:0!important; justify-content:flex-start!important; }
 body[data-lds-shell] .app-nav { z-index:var(--lds-z-sticky); }
}

/* Legacy sticky offsets must not displace an in-flow section rail over copy. */
body[data-lds-shell] :is(.color-page-nav,.lds-page-section-nav) {
  top: auto !important;
}
@media (max-width:1199px) {
  body[data-lds-shell] .app-nav { position:sticky !important; top:0; }
}
@media (max-width:1199px) {
  body[data-lds-shell] .app-nav { padding:var(--lds-space-2) var(--lds-space-4) !important; }
  body[data-lds-shell] .nav-rail-card { height:auto !important; min-height:0 !important; }
}
@media (max-width:600px) {
  body[data-lds-shell][data-lds-shell-standard="nacreous"],
  body[data-lds-shell][data-lds-shell-standard="nacreous"] .foundation-editorial-page {
    --lds-editorial-hero-title-size:var(--lds-display-lg);
  }
}
