/* ===== ca_manage_monthly_quantities_modal_html (HTML form, scoped) =====
   The Manage Monthly Quantities pop-up. Every rule here comes from the form's
   old <style> block; nothing is dropped, and the only additions are the two
   rules that replace the template's two inline style attributes (marked
   below), which a template may not carry.

   Loaded eagerly from anvil.yaml native_deps.head_html.

   SCOPE IS #pa-qty-overlay, WHICH IS ALSO THE FORM ROOT. pxShowOverlay PORTALS
   this node into #px-modal-portal on every open, so scoping on it is what keeps
   these rules matching once the pop-up is open. Same answer as the sibling
   ca_manage_acute_drugs_modal_html. :where() adds zero specificity, so
   :where(#pa-qty-overlay) .pa-qty-row weighs exactly what the bare .pa-qty-row
   it replaces did.

   DOUBLED CLASS, and why. As a head link these rules load before the
   dependency's runtime-injected theme, so they lose every tie on document
   order. One selector is affected, and it is the one that replaces the
   inline style on the dialog box:

     .pa-qty-modal  ties the dependency .px-modal  ->  .px-modal.pa-qty-modal

   Both classes are already on the element, so no markup changed.
   .pa-qty-add .px-input and .pa-qty-modal .px-modal-body are two-class
   selectors and already outweigh the one-class shared rules they meet.

   NO DESIGNER GATE, and nothing to gate on. The only rule that hides this
   form's content is the DEPENDENCY's .px-modal-overlay { opacity: 0 }, injected
   by Python at runtime; the designer runs no Python, so this canvas is drag-only
   today and stays drag-only. There is no live class here.

   No url(), no @font-face, no @keyframes, no html rule and no :root block in
   this form: nothing to rewrite. .themed-scrollbar stays the dependency's and
   is not declared here. */

/* dialog sizing. Doubled, per the block above. */
:where(#pa-qty-overlay) .px-modal.pa-qty-modal {
  max-width: 500px;
  width: 100%;
}

:where(#pa-qty-overlay) .pa-qty-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

:where(#pa-qty-overlay) .pa-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--px-bg-elevated);
  border-radius: var(--px-radius-sm);
  border: 1px solid var(--px-border);
  font-family: var(--px-mono);
  font-size: 14px;
}

:where(#pa-qty-overlay) .pa-qty-row .pa-qty-value {
  font-weight: 600;
}

:where(#pa-qty-overlay) .pa-qty-add {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

:where(#pa-qty-overlay) .pa-qty-add .px-input {
  max-width: 160px;
}

/* `max-width: 160px` was style="max-width:160px;" on #pa-qty-input. It DUPLICATES
   the class rule above everywhere except inside the 600px media query below,
   where the class rule says 100% and the inline declaration beat it. At (1,0,0)
   this id rule outranks that class rule exactly as the attribute did; dropping
   the attribute without it is a real mobile layout change. */
:where(#pa-qty-overlay) #pa-qty-input {
  max-width: 160px;
}

@media (max-width: 600px) {
  :where(#pa-qty-overlay) .pa-qty-add {
    flex-direction: column;
    align-items: stretch;
  }
  :where(#pa-qty-overlay) .pa-qty-add .px-input { max-width: 100%; }
  :where(#pa-qty-overlay) .pa-qty-row { font-size: 13px; }
}

:where(#pa-qty-overlay) .pa-qty-modal .px-modal-body {
  display: flex;
  flex-direction: column;
}
