/* Loans on phones: one even gutter instead of stacked padding.
   Before this, content sat 34px in on the overview (1px dialog border + 16px page + 16px card)
   and 42px in on the planner (14px sheet + 10px tray + 16px inner card).
   Now the page edge is 12px and a card adds 14px, so card text sits about 26px in. */
@media (max-width:480px){
  /* The workspace fills the phone, so a side border only eats width. */
  html[data-theme] dialog.private-workspace.private-workspace{border-inline-width:0}

  /* Page gutter: heading, body and footer share one 12px edge. */
  html[data-theme] dialog.private-workspace.private-workspace>.dialog-heading,
  html[data-theme] dialog.private-workspace.private-workspace>.entry-fields,
  html[data-theme] dialog.private-workspace.private-workspace>.dialog-footer{padding-inline:12px}

  /* Cards and list rows: 14px inside the hairline. */
  html[data-theme] dialog.private-workspace.private-workspace :is(.lr-card,.loan-sheet-card,.private-history),
  html[data-theme] dialog.private-workspace.private-workspace .private-loan-list .lr-open,
  html[data-theme] dialog.private-workspace.private-workspace .lr-list .lx-lrow>.lr-open,
  html[data-theme] dialog.private-workspace.private-workspace .lx-list>.lx-row,
  html[data-theme] dialog.private-workspace.private-workspace .lr-planbox>.lr-card,
  html[data-theme] dialog.private-workspace.private-workspace :is(.loan-sheet-alloc,.loan-sheet-explanation)>summary{padding-inline:14px}
  html[data-theme] dialog.private-workspace.private-workspace .lx-attn-fold>summary{padding-inline:14px}
  html[data-theme] dialog.private-workspace.private-workspace .lr-list{--lr-in:14px}

  /* Planner sheet: same 12px edge; the grey tray hugs its white card instead of
     adding a second 10px + 16px inset. */
  html[data-theme] dialog.private-workspace .lr-sheet-body{padding-inline:12px}
  html[data-theme] dialog.private-workspace .lr-sheet-head{padding-inline:4px}
  html[data-theme] dialog.private-workspace .lr-sheet-body .lr-tl{padding-inline:14px}
  html[data-theme] dialog.private-workspace .lr-sheet-body .lr-sim{padding:6px;border-radius:22px}
  html[data-theme] dialog.private-workspace .lr-sheet-body .lr-sim-in{padding-inline:12px;border-radius:17px}
  /* The pinned "I can pay" block bleeds to the white card's edge, so it follows the new inset. */
  html[data-theme] dialog.private-workspace .lr-sheet .lr-pin{margin-inline:-12px;padding-inline:12px;border-radius:17px 17px 0 0}
  html[data-theme] dialog.private-workspace .lr-sheet .lr-pin.compact{padding-inline:12px;border-radius:0}
}

/* The narrowest phones (320px) give back two more pixels at the edge. */
@media (max-width:359px){
  html[data-theme] dialog.private-workspace.private-workspace>.dialog-heading,
  html[data-theme] dialog.private-workspace.private-workspace>.entry-fields,
  html[data-theme] dialog.private-workspace.private-workspace>.dialog-footer,
  html[data-theme] dialog.private-workspace .lr-sheet-body{padding-inline:10px}
  html[data-theme] dialog.private-workspace.private-workspace :is(.lr-card,.loan-sheet-card,.private-history){padding-inline:12px}
}
