/* Shared last-mile responsive guarantees for public, account and workspace views. */
html { min-width: 320px; }
body { max-width: 100%; }
img, picture, video, canvas, iframe { max-inline-size: 100%; }
main :where(section, article, aside, div, form, fieldset, li) { min-inline-size: 0; }
:where(h1, h2, h3, h4, p, li, dd, dt, a, button, label, small, strong, span) { overflow-wrap: break-word; }
:where(input, select, textarea) { max-inline-size: 100%; }
:where(.table-card, .party-table-wrap, .preview-table-wrap, .access-table, .privacy-table-wrap, .sla-priority-table) {
  max-inline-size: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
:where(.section-toolbar, .ops-header, .ops-actions, .page-actions, .hero-actions, .party-hero-actions, .report-section-title) { flex-wrap: wrap; }
dialog { max-inline-size: min(720px, calc(100vw - 32px)); max-block-size: calc(100dvh - 32px); overflow: auto; }

@media (max-width: 900px) {
  :where(.card, .panel, .ops-panel) { max-inline-size: 100%; }
  :where(.section-toolbar, .ops-header, .page-heading, .report-section-title) > * { min-inline-size: 0; }
  .analytics-consent { max-block-size: min(48dvh, 360px); overflow-y: auto; overscroll-behavior: contain; }
}

@media (max-width: 640px) {
  :root { --mobile-edge: 12px; }
  .shell { width: min(calc(100% - (2 * var(--mobile-edge))), 1160px); }
  :where(.button, button, input:not([type="checkbox"]):not([type="radio"]), select, textarea, summary) { min-block-size: 44px; }
  :where(input, select, textarea) { font-size: 16px; }
  :where(.page-heading, .section-toolbar, .ops-header, .report-section-title) { gap: 12px; }
  :where(.page-heading, .section-toolbar, .ops-header, .report-section-title) > :where(.button, button, form) { max-inline-size: 100%; }
  :where(.hero-actions, .page-actions, .party-hero-actions) > :where(.button, button, a) { flex: 1 1 100%; justify-content: center; }
  .analytics-consent {
    inset-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
    inset-block-end: max(8px, env(safe-area-inset-bottom));
    max-block-size: min(55dvh, 390px);
  }
  .analytics-consent-actions button { min-block-size: 44px; }
  .user-popover { max-inline-size: calc(100vw - 24px); }
}

@media (max-width: 380px) {
  .brand strong { font-size: 16px; }
  .header-inner { gap: 8px; }
  :where(.card, .panel, .ops-panel) { border-radius: 18px; }
  .analytics-consent-actions { grid-template-columns: 1fr; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .public-mobile-panel, .user-popover, .workspace-sidebar { max-block-size: calc(100dvh - 72px); overflow-y: auto; }
  .analytics-consent { max-block-size: calc(100dvh - 16px); }
}

@media (hover: none) and (pointer: coarse) {
  :where(.public-mobile-panel a, .workspace-menu-link, .private-footer-nav a, .footer-links a) { min-block-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

form.form-submit-pending [data-submit-active="true"] { cursor: wait; opacity: .78; }
form.form-submit-pending [data-submit-active="true"]::after { content: " …"; }
