/* GlowNow Top100 83/84/86/88: touch geometry, safe areas and AA contrast. */
:root {
  --gn-action-target: 44px;
  --gn-touch-primary-target: 48px;
}

/* Reserve the canonical admin header before its deferred controller replaces
   the slot. The real header has the same block size, so main content does not
   jump after first paint. */
.admin-page > .gn-command-header-slot {
  min-height: 73px;
}

/* Preserve the existing visual control while expanding its interactive box. */
:where(.launch-brand, .launch-mobile-request, #themeToggle, #mobileMenuToggle, .launch-theme-toggle, .launch-mobile-toggle) {
  min-inline-size: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
  align-items: center;
  justify-content: center;
}

/* `hidden` is a state contract, not a suggestion. Route CSS declares the
   booking panels as grids, which otherwise wins over the user-agent rule for
   a frame and exposes steps 2-6 before the booking controller starts. */
[data-booking-section][hidden] {
  display: none !important;
}

/* Admin route styles declare panels as grids. The hidden state must win from
   first paint so private/data-backed panels cannot flash before hydration. */
body.admin-page [hidden] {
  display: none !important;
}

/* Compact booking controls are still actions. Use physical dimensions as
   well as logical ones because legacy route rules mix both axes. */
.booking-steps button,
.booking-intake-quick-chips button,
.treatment-category-filters button {
  box-sizing: border-box;
  min-width: var(--gn-action-target) !important;
  min-height: var(--gn-action-target) !important;
}

html body.launch-body .booking-intake-assistant .booking-intake-quick-chips button {
  min-width: var(--gn-action-target) !important;
  min-height: var(--gn-action-target) !important;
}

html body.launch-body .treatment-finder-toolbar .treatment-category-filters button {
  min-width: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target) !important;
}

.launch-footer nav a {
  display: inline-flex !important;
  height: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
  align-items: center;
  justify-content: center;
}

/* Booking filters and compact disclosures are real actions, not text chips. */
:where(.treatment-category-filters button, #treatmentGuideToggle) {
  height: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
}

.launch-checkbox a {
  display: inline-flex;
  min-inline-size: var(--gn-action-target);
  min-block-size: var(--gn-action-target);
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* The private admin is dense, but every explicit command remains operable. */
.admin-page :where(
  button,
  select,
  textarea,
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])
) {
  box-sizing: border-box;
  min-height: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
}

.admin-page a[href] {
  box-sizing: border-box;
  display: inline-flex;
  min-width: var(--gn-action-target) !important;
  min-height: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
  align-items: center;
  justify-content: center;
}

/* Physical dimensions intentionally accompany logical dimensions: several
   legacy modules still ship later `min-height: 42px !important` rules. */
body.admin-page :where(
  button:not([disabled]),
  select:not([disabled]),
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([disabled])
) {
  height: var(--gn-action-target) !important;
  min-height: var(--gn-action-target) !important;
}

body.admin-page a[href] {
  min-width: var(--gn-action-target) !important;
  min-height: var(--gn-action-target) !important;
}

.admin-page :where(
  #saveAdminKey,
  .ops-header-actions a,
  .launch-radar-tags a,
  a[href="/guides/"],
  a[href="/seo-launch-prep.html"],
  summary
) {
  height: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
  align-items: center;
  justify-content: center;
}

html body.admin-page input[type="checkbox"],
html body.admin-page input[type="radio"] {
  box-sizing: border-box;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  min-inline-size: 24px !important;
  min-block-size: 24px !important;
}

html body.admin-page :where(label:has(input[type="checkbox"]), label:has(input[type="radio"])) {
  min-inline-size: var(--gn-action-target);
  min-block-size: var(--gn-action-target) !important;
}

.admin-page .launch-trial-scenario a[href] {
  display: inline-flex;
  height: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target);
  min-block-size: var(--gn-action-target);
  align-items: center;
  justify-content: center;
}

.admin-page .launch-trial-issue-form :where(
  select,
  input:not([type="checkbox"]):not([type="radio"])
),
.admin-page .admin-review-action,
.admin-page .admin-review-step a[href] {
  box-sizing: border-box;
  height: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
}

/* Generated operational panels previously mixed 36/38/42px controls. Keep
   their appearance, but give every command a consistent pointer/touch box. */
.admin-page :where(.ops-panel, [id$="Os"]) :where(
  button,
  select,
  textarea,
  input:not([type="checkbox"]):not([type="radio"])
) {
  box-sizing: border-box;
  min-block-size: var(--gn-action-target) !important;
}

.admin-page :where(.ops-panel, [id$="Os"]) a[href] {
  box-sizing: border-box;
  display: inline-flex;
  min-inline-size: var(--gn-action-target);
  min-block-size: var(--gn-action-target) !important;
  align-items: center;
  justify-content: center;
}

.admin-page :where(
  .admin-owner-test-step a[href],
  .admin-owner-test-card a[href],
  .supply-crm-source-grid a[href],
  .launch-route-quality-routes a[href],
  a[target="_blank"][rel*="noreferrer"]
) {
  box-sizing: border-box;
  display: inline-flex;
  height: var(--gn-action-target) !important;
  min-inline-size: var(--gn-action-target) !important;
  min-block-size: var(--gn-action-target) !important;
  align-items: center;
  justify-content: center;
}

/* Dynamic v2 surfaces inherit the same action contract when intent-mounted. */
:where(
  #clientInspirationV2,
  #clientAccountV2,
  #providerV2Workspace,
  #adminProductOperationsV2,
  #adminApplicationLifecycleV2,
  #adminPrivacyEventsPanel
) :where(button, a[href], summary, [role="button"], [role="tab"]) {
  min-inline-size: var(--gn-action-target);
  min-block-size: var(--gn-action-target);
}

/* The full-bleed consent surface may reach the edge; actions may not enter the
   home-indicator area. */
html body.launch-body .glownow-consent,
.glownow-consent {
  bottom: max(20px, env(safe-area-inset-bottom, 0px)) !important;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)) !important;
}

/* Light admin: replace decorative low-contrast gold/mauve microcopy. */
body.admin-page:not([data-theme="dark"]) :where(
  .supply-crm-form-head > span,
  .launch-trial-scenario label > span
) {
  color: #5f2c45 !important;
}

body.admin-page:not([data-theme="dark"]) .supply-crm-pipeline > article > span {
  color: #70401f !important;
}

/* Dark admin: every status label remains AA against translucent panels. */
body.admin-page[data-theme="dark"] :where(
  .admin-integration-panel .ops-panel-title .eyebrow,
  .admin-trust-queue .ops-panel-title .eyebrow
) {
  color: #ffd98a !important;
}

body.admin-page[data-theme="dark"] .admin-rehearsal-banner > strong {
  color: #fff7fb !important;
}

body.admin-page[data-theme="dark"] .launch-suite-panel .suite-number {
  border-color: rgba(255, 211, 229, 0.38) !important;
  background: #3a1730 !important;
  color: #fff7fb !important;
}

body.admin-page[data-theme="dark"] .supply-crm-source-grid a[href] {
  color: #ffd7e8 !important;
}

/* Small uppercase evidence labels need their own light-theme contrast token;
   the decorative gold used for borders and large accents is too pale at
   11–12px on the admin surfaces. */
body.admin-page:not([data-theme="dark"]) :is(
  .admin-recruitment-hero span,
  .admin-rubric-card span
),
html:not([data-theme="dark"]) body.admin-page :is(
  .admin-recruitment-hero span,
  .admin-rubric-card span
) {
  color: #7a2e4d !important;
}

body.admin-page:not([data-theme="dark"]) .suite185-release > div > span,
html:not([data-theme="dark"]) body.admin-page .suite185-release > div > span {
  color: #7c520d !important;
}

@media (max-width: 768px) {
  :where(.launch-mobile-request, .launch-primary, button[type="submit"], input[type="submit"]) {
    min-block-size: var(--gn-touch-primary-target) !important;
  }

  /* This is the dominant admin action, not a compact toolbar control. Keep
     its physical height at the 48px primary-action contract even though the
     generic admin target rule above deliberately fixes dense controls at 44px. */
  html body.admin-page .suite170-admin .suite170-form > button.is-primary.wide {
    height: var(--gn-touch-primary-target) !important;
    min-height: var(--gn-touch-primary-target) !important;
    min-block-size: var(--gn-touch-primary-target) !important;
  }

  html body.admin-page a.primary {
    height: var(--gn-touch-primary-target) !important;
    min-height: var(--gn-touch-primary-target) !important;
    min-block-size: var(--gn-touch-primary-target) !important;
  }
}

@media (max-width: 374px) {
  /* Four header actions fit a 320px viewport at the same 44px geometry. */
  html body.launch-body .launch-shell > .launch-header:not(#globalCommandHeader) > .launch-container.launch-header-inner {
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px !important;
    column-gap: 4px !important;
    width: auto !important;
    max-width: none !important;
    margin-left: max(8px, env(safe-area-inset-left, 0px)) !important;
    margin-right: max(8px, env(safe-area-inset-right, 0px)) !important;
    padding-inline: 0 !important;
  }

  html body.launch-body .launch-header:not(#globalCommandHeader) :is(
    .launch-brand,
    .launch-brand img,
    .launch-logo,
    .launch-mobile-request,
    #themeToggle,
    #mobileMenuToggle,
    .launch-theme-toggle,
    .launch-mobile-toggle
  ) {
    box-sizing: border-box;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  html body.launch-body .launch-header:not(#globalCommandHeader) .launch-mobile-request {
    width: auto !important;
  }

  .booking-steps {
    gap: 2px !important;
    padding: 3px !important;
  }
}

@media (forced-colors: active) {
  :where(button, a[href], summary, [role="button"], [role="tab"]):focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: 2px;
  }
}
