/* Upload modal (photos + reels) — see templates/social/upload_modal.html.
   Sits above the shell topbar (z-index 50) and the community rail, below the
   story creator so the two never fight for the same layer. */
.agu[hidden] { display: none; }
.agu {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.agu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.agu__dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--ag-color-bg-surface, #fff);
  border-radius: var(--ag-radius-lg, 16px);
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.28);
  overflow: hidden;
}
.agu__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ag-color-border, rgba(15, 23, 42, 0.1));
  /* Chrome must not be squeezed when the body scrolls — the same flex trap that
     collapsed the notification tabs. */
  flex-shrink: 0;
}
.agu__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ag-color-text-heading, #0b1736);
}
.agu__full {
  margin-inline-start: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ag-color-brand-primary, #2563eb);
  text-decoration: none;
}
.agu__full:hover { text-decoration: underline; }
.agu__close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--ag-color-text-muted, #64748b);
  padding: 0 4px;
}
.agu__close:hover { color: var(--ag-color-text-heading, #0b1736); }
.agu__body {
  padding: 18px;
  overflow-y: auto;
  /* min-height:0 lets THIS element absorb the overflow instead of crushing the header. */
  min-height: 0;
  flex: 1;
}
.agu__loading,
.agu__error {
  margin: 0;
  padding: 32px 0;
  text-align: center;
  color: var(--ag-color-text-muted, #64748b);
}
.agu__error { color: var(--ag-color-error, #dc2626); }

/* The fragment ships the page's card chrome; inside the dialog that double-frames it. */
.agu__body > form.ag-card {
  border: none;
  box-shadow: none;
  padding: 0 !important;
  background: transparent;
}

@media (max-width: 640px) {
  .agu { padding: 0; }
  .agu__dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
}
