/*
 * INFLUXA Desktop & Tablet Foundation — V1.2.20.7
 * Additive opt-in layout primitives. Existing pages are unchanged until
 * shared UI adds the data-influxa-adaptive attribute/classes.
 */
:root {
  --infx-layout-gutter: clamp(1rem, 2.4vw, 2.25rem);
  --infx-content-max: 1440px;
  --infx-sidebar-width: 17rem;
  --infx-panel-gap: clamp(.75rem, 1.5vw, 1.5rem);
  --infx-touch-target: 2.75rem;
}
.infxa-adaptive-shell {
  width: min(100% - (var(--infx-layout-gutter) * 2), var(--infx-content-max));
  margin-inline: auto;
}
.infxa-adaptive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--infx-panel-gap);
  min-width: 0;
}
.infxa-adaptive-main, .infxa-adaptive-sidebar, .infxa-adaptive-panel {
  min-width: 0;
  overflow-wrap: anywhere;
}
.infxa-adaptive-sidebar { display: none; }
.infxa-adaptive-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .625rem;
  min-width: 0;
}
.infxa-adaptive-toolbar > * { max-width: 100%; }
.infxa-adaptive-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.infxa-adaptive-scroll:focus-visible {
  outline: 2px solid var(--infx-focus, #7654c8);
  outline-offset: 3px;
}
.infxa-adaptive-shell :where(button, a, input, select, textarea, summary) {
  scroll-margin-block: 5rem;
}
.infxa-adaptive-shell :where(button, [role="button"], input, select) {
  min-height: var(--infx-touch-target);
}
.infxa-adaptive-shell :where(img, video, canvas, svg) { max-width: 100%; }
@media (min-width: 768px) {
  :root { --infx-layout-gutter: clamp(1.25rem, 3vw, 2.5rem); }
  .infxa-adaptive-grid { grid-template-columns: minmax(13rem, 0.28fr) minmax(0, 1fr); }
  .infxa-adaptive-sidebar { display: block; }
}
@media (min-width: 1024px) {
  .infxa-adaptive-grid.infxa-adaptive-grid--workspace {
    grid-template-columns: minmax(14rem, 0.22fr) minmax(0, 1fr) minmax(15rem, 0.25fr);
  }
}
@media (min-width: 1440px) {
  .infxa-adaptive-shell { --infx-content-max: 1600px; }
}
@media (max-width: 767px) {
  .infxa-adaptive-shell { width: min(100% - 1.25rem, var(--infx-content-max)); }
  .infxa-adaptive-grid { grid-template-columns: minmax(0, 1fr); }
  .infxa-adaptive-shell [data-infxa-hide-compact="true"] { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .infxa-adaptive-shell *, .infxa-adaptive-shell *::before, .infxa-adaptive-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
@media (forced-colors: active) {
  .infxa-adaptive-shell :focus-visible { outline: 2px solid Highlight; }
}

/* Shared shell integration: preserve the existing 760px navigation boundary. */
.infxa-mobile-menu { display:none; }
@media (max-width:760px) {
 .infxa-mobile-menu { display:block; padding: .5rem max(1rem,env(safe-area-inset-right)) .5rem max(1rem,env(safe-area-inset-left)); background:var(--panel); border-bottom:1px solid var(--line); }
 .infxa-mobile-menu summary { min-height:44px; padding:.75rem; cursor:pointer; }
 .mobile-full-nav { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%, 10rem),1fr)); gap:.25rem; max-height:35vh; overflow:auto; }
 .mobile-full-nav a { display:flex; align-items:center; gap:.5rem; min-height:44px; padding:.5rem; border-radius:var(--radius,8px); overflow-wrap:anywhere; }
 .mobile-full-nav a[aria-current] { background:var(--accent); color:var(--on); }
 .mobile-full-nav a:focus-visible,.infxa-mobile-menu summary:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
}
@media (min-width:761px) { .app-layout { grid-template-columns:clamp(180px,19vw,248px) minmax(0,1fr); } }
