/* Shared sizing rules for every Toolbox view, including dynamically rendered forms. */
.event-import-entry { margin: 0 0 20px; }
.event-import-entry:has([hidden]) { display: none; }
.studio-design-start { display: grid; gap: 14px; }

.workspace,
.auth-panel {
  overflow-wrap: anywhere;
}

.workspace :where(div, section, article, form, fieldset, label),
.auth-card {
  min-width: 0;
}

.workspace :where(input, select, textarea, button),
.auth-card :where(input, button) {
  min-width: 0;
  max-width: 100%;
}

.workspace :where(img, canvas, video, iframe) {
  max-width: 100%;
}

/* WebKit can include a native option's untruncated width in a form's scroll
   area even when the select's own box fits. Its picker keeps full labels. */
select:not([multiple]) { overflow: hidden; }

.page-heading,
.page-heading-actions,
.panel-title,
.form-actions,
.dialog-head,
.dialog-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.page-heading > *,
.panel-title > *,
.form-actions > *,
.dialog-head > *,
.dialog-actions > * {
  min-width: 0;
  max-width: 100%;
}

.segmented,
.booking-tabs {
  flex-wrap: wrap;
  overflow: visible;
}

.segmented button {
  white-space: normal;
  flex: 1 1 auto;
  min-height: 44px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr);
}

.qr-tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.funding-filters,
.bundle-ledger-filters {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
}

.bundle-ledger-filters button {
  grid-column: auto;
}

.notice,
.funding-filter-tree > summary {
  overflow-wrap: anywhere;
  white-space: normal;
}

.funding-filter-tree,
.funding-filter-tree > summary {
  height: auto;
  min-height: 44px;
}

/* The single-column workspace also serves tablets. */
@media (max-width: 1024px) {
  .toolbox-shell { display: block; }
  .workspace { width: 100%; }
  .topbar {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 15px;
  }
  .top-actions { margin-left: auto; gap: 6px; }
  .top-actions .primary { display: none; }
  .adventure-switcher { order: 3; width: 100%; }
  .adventure-switcher span { flex: 0 1 auto; }
  .adventure-switcher select { flex: 1; width: auto; min-width: 0; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .booking-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace > .view { padding-inline: 16px; }
  .panel, .dialog-card { padding: 16px; }
  .page-heading-actions { flex-wrap: wrap; }
  .page-heading-actions > * { flex: 1 1 150px; }
  .form-grid, .bundle-ledger-filters, .funding-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbox-locales a { min-height: 32px; display: inline-flex; align-items: center; }
  /* Avoid iOS zooming the viewport when a form field receives focus. */
  .workspace :where(input, select, textarea),
  .auth-card :where(input, select, textarea) { font-size: 16px; }
}
