/* Size the workspace by the space available after navigation and browser scaling. */
.workspace-body { min-width: 0; }
.workspace-main { container: workspace / inline-size; }
.workspace-main > *, .workspace-page-header > *, .page-heading > *,
.heading-actions, .site-actions, .filter-panel > *, .summary-grid > * { min-width: 0; }
.workspace-main h1, .workspace-main td, .workspace-main .app-notice,
.snapshot-note, .workspace-page-header a { overflow-wrap: anywhere; }
.workspace-main .overflow-x-auto { max-width: 100%; overscroll-behavior-x: contain; }
.workspace-main textarea, .workspace-main input, .workspace-main select { max-width: 100%; }
.workspace-topbar, .workspace-footer { min-width: 0; }
.topbar-location { min-width: 0; }
.topbar-location strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account { flex-shrink: 0; }
.sidebar { overflow: hidden; }
.sidebar > * { flex-shrink: 0; }
.sidebar-links { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sidebar-profile { margin-top: 16px; }
.sidebar-note { margin-top: 16px; }
.page-heading, .workspace-page-header { flex-wrap: wrap; align-items: flex-start; }
.page-heading > :first-child, .workspace-page-header > :first-child { flex: 1 1 320px; }
.heading-actions, .site-actions { justify-content: flex-start; }
.workspace-page-header .site-actions { flex: 1 1 100%; }
.section-heading, .table-heading { gap: 12px; flex-wrap: wrap; }
.section-heading > *, .table-heading > * { min-width: 0; }
.overview-banner-copy > div { min-width: 0; }
.workspace-filters, .filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 14px;
}
.workspace-filters > div { grid-column: auto; min-width: 0; }
.workspace-filters input, .workspace-filters select { width: 100%; }
.workspace-filters > div:last-child { align-self: end; }
.action-modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-header > div { min-width: 0; }
.modal-header h2 { overflow-wrap: anywhere; }
.modal-header .icon-button { flex-shrink: 0; }

@media (min-width: 1101px) and (max-width: 1440px) {
  :root { --sidebar: 220px; }
  .sidebar { padding: 22px 12px 16px; }
  .brand { font-size: 18px; gap: 9px; padding-inline: 6px; }
  .brand small { font-size: 8px; }
  .workspace-main { padding: 26px 24px 32px; }
  .workspace-topbar, .workspace-footer > div { padding-inline: 24px; }
  .workspace-label { margin: 22px 4px 20px; }
}
@media (max-height: 820px) {
  .sidebar-note { display: none; }
  .workspace-label { margin-block: 18px; }
  .sidebar-links .nav-label { margin-top: 20px; }
  .sidebar-link { padding-block: 11px; }
}
@media (max-width: 1100px) {
  .workspace-main { padding: 24px; }
  .workspace-topbar, .workspace-footer > div { padding-inline: 24px; }
}
@container workspace (min-width: 650px) {
  .workspace-filters > div:first-of-type { grid-column: span 2; }
}
@container workspace (max-width: 880px) {
  .metric-grid, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-grid { grid-template-columns: 1fr; }
  .page-heading, .workspace-page-header { flex-direction: column; align-items: stretch; gap: 16px; }
  .page-heading > :first-child, .workspace-page-header > :first-child,
  .workspace-page-header .site-actions { flex-basis: auto; }
  .metric-card { padding: 18px; }
}
@container workspace (max-width: 560px) {
  .overview-banner { align-items: flex-start; flex-direction: column; padding: 18px; }
  .workspace-filters, .filter-panel { grid-template-columns: 1fr; }
  .pagination > div { flex-wrap: wrap; }
  .inventory-table td, .inventory-table th { padding: 12px; }
}
@media (max-width: 600px) {
  .workspace-main { padding: 20px 16px 28px; }
  .workspace-topbar, .workspace-footer > div { padding-inline: 16px; }
  .topbar-location { gap: 10px; }
  .topbar-account { gap: 10px; }
  .workspace-main h1 { font-size: 22px; }
  .modal-header, .modal-content { padding: 18px; }
  .heading-actions, .site-actions { gap: 8px; }
  .heading-actions .app-button, .site-actions .app-button { padding-inline: 12px; }
  .summary-grid { grid-template-columns: 1fr; }
}
