/* Phone layout (< 744px) for the fees screens — see the mobile handoff. */
@media (max-width:743.98px){
  /* ------------------------------------------------------------ Fees desk */
  /* Find and Class each span the row (there is no Show filter to pair Class
     with); the More filters link and its drawer span the row under them. */
  .fees-m-bar{margin-bottom:12px}
  .fees-m-bar > .inline-field:has(.combo){grid-column:1 / -1}
  .fees-m-bar > .fees-m-morelink,.fees-m-bar > .fees-m-more{grid-column:1 / -1}
  .fees-m-morelink{display:inline-flex;align-items:center;gap:6px;justify-self:start;width:auto!important;
    min-height:44px;padding:0 2px;font-size:15px;font-weight:600;color:var(--accent)}
  .fees-m-morelink .ico{transition:transform .15s}
  .fees-m-morelink.open .ico{transform:rotate(180deg)}
  .fees-m-more:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr);gap:10px;
    padding-top:10px;border-top:1px solid #EDF0EC}
  .fees-m-colhead{font-size:12px;color:#5C6D64;margin-top:2px}
  .fees-m-colchips{display:flex;flex-wrap:wrap;gap:8px}
  .fees-m-colchip{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;
    border:1.5px solid #E5EAE6;border-radius:99px;background:#F5F8F4;color:#16211C;font:inherit;font-size:14px}
  .fees-m-colchip .ico{color:#5C6D64}
  .fees-m-colchip.on{background:#DDEEE8;border-color:#8CC9B8;color:#0A5A49}
  .fees-m-colchip.on .ico{color:#0A5A49}

  /* Record Payment fills the row; everything else is under More */
  .fees-m-actions{display:flex;gap:10px;align-items:stretch;margin-bottom:14px}
  .fees-m-actions > .btn{flex:1;justify-content:center;min-height:52px;font-weight:600}
  .fees-m-actions > .moremenu{flex:none;margin-left:auto}
  .fees-m-actions .moremenu-btn{min-height:52px}

  /* Paid / Outstanding side by side, even at 360 */
  .cards.fees-m-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
  .fees-m-cards .card{padding:12px 14px;min-width:0}
  .fees-m-cards .card .v{font-family:var(--mono);font-size:18px;font-weight:600;letter-spacing:-.01em;
    overflow-wrap:anywhere}
  .fees-m-cards .card:nth-child(3){grid-column:1 / -1}

  /* the student list: rows in one white card */
  .fees-m-list{display:flex;flex-direction:column;background:#fff}
  .fees-m-row{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:10px 14px;
    border:0;border-bottom:1px solid #EDF0EC;background:none;font:inherit;color:#16211C;text-align:start;cursor:pointer}
  .fees-m-row:last-child{border-bottom:0}
  .fees-m-row:active{background:#F5F8F4}
  .fees-m-row.slim{min-height:56px}
  .fees-m-av{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;
    background:#DDEEE8;color:#0A5A49;font-family:var(--mono);font-size:14px;font-weight:600}
  .fees-m-who{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
  .fees-m-name{font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .fees-m-sub{font-size:14px;color:#5C6D64;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .fees-m-amt{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:2px;text-align:end}
  .fees-m-out{font-family:var(--mono);font-size:15px;font-weight:600;white-space:nowrap}
  .fees-m-out.due{color:#9C332B}
  .fees-m-amt-n{font-size:12px;color:#5C6D64}
  .fees-m-chev{flex:none;color:#5C6D64;transform:rotate(-90deg)}

  /* ------------------------------------------------------- the statement */
  .fees-m-sheet{height:calc(100% - 24px)}
  .fees-m-stmt{flex:1;align-content:start;gap:10px}
  .fees-m-stmt .fees-m-cards{margin-bottom:4px}
  .fees-m-stmt-who{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
  .fees-m-stmt-who .linkbtn.namelink{font-size:15px;min-height:44px}
  .fees-m-h{font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#5C6D64;
    margin-top:6px}
  .fees-m-stmt .fees-m-list{border:1px solid #E5EAE6;border-radius:16px;overflow:hidden}
  .fees-m-stmt .empty{background:#fff;border:1px solid #E5EAE6;border-radius:16px;padding:20px;font-size:14px}
  .fees-m-line{padding:12px 14px;border-bottom:1px solid #EDF0EC}
  .fees-m-line:last-child{border-bottom:0}
  .fees-m-line-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
  .fees-m-line-name{min-width:0;font-size:16px;font-weight:600;overflow-wrap:anywhere}
  .fees-m-line-name .mono{font-size:13px;font-weight:600;color:#5C6D64}
  .fees-m-pill{flex:none;display:inline-flex;align-items:center;min-height:24px;padding:2px 10px;border-radius:99px;
    font-size:12px;font-weight:600;background:#EEF1EE;color:#46564D}
  .fees-m-pill.paid{background:#DDF1E8;color:#0A6B52}
  .fees-m-pill.owing{background:#F7E4E1;color:#9C332B}
  .fees-m-pill.partial{background:#F7EED9;color:#7A5A0E}
  .fees-m-figs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px}
  .fees-m-fig{display:flex;flex-direction:column;gap:1px;min-width:0}
  .fees-m-fig:last-child{text-align:end}
  .fees-m-fig-k{font-size:12px;color:#5C6D64}
  .fees-m-fig-v{font-family:var(--mono);font-size:14px;overflow-wrap:anywhere}
  .fees-m-fig-v.due{color:#9C332B;font-weight:600}
  .fees-m-rcpt{display:flex;align-items:center;gap:12px;min-height:64px;padding:10px 14px;
    border-bottom:1px solid #EDF0EC}
  .fees-m-rcpt:last-child{border-bottom:0}
  .fees-m-rcpt .btn{flex:none;min-height:44px;padding:6px 12px;font-size:14px}
  /* Record payment / Write off: a bar pinned under the scrolling statement */
  .fees-m-actbar{position:sticky;bottom:0;display:flex;gap:10px;border-top:1px solid #E5EAE6}
  .fees-m-actbar .btn{flex:1;min-height:52px;justify-content:center;font-weight:600;gap:8px}

  /* the record-payment sheet: one column, thumb-sized rows, total on its own line */
  .fees-collect .payment-lines{max-height:none;background:#fff;border-radius:16px}
  .fees-collect .payment-lines .pickrow{min-height:56px;padding:8px 12px}
  .fees-collect .payment-lines .pickrow > .grow{min-width:0;overflow-wrap:anywhere}
  .fees-collect .payment-lines input[type=number]{width:112px!important;flex:none}
  .fees-collect .payment-lines input[type=checkbox]{width:22px;height:22px}
  .fees-collect > footer{flex-wrap:wrap;align-items:center}
  .fees-collect > footer > .spacer{flex:1 0 100%;height:0}

  /* ------------------------------------------- Fee setup and Fees report */
  /* a .bar.tight of buttons inside a filter card or a panel header is a row
     of buttons, not a second card */
  .fees-m-admin .bar > .bar.tight{grid-column:1 / -1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;padding:0;border:0;background:none;border-radius:0}
  .fees-m-admin .bar > .bar.tight > .btn{width:100%;justify-content:center}
  .fees-m-admin .bar > .count{align-self:center}
  .fees-m-admin .panel > header,.fees-m-report .panel > header{flex-wrap:wrap}
  .fees-m-admin .panel > header .bar.tight,.fees-m-report .panel > header .bar.tight{display:flex;flex-wrap:wrap;
    align-items:center;gap:8px;padding:0;border:0;background:none;border-radius:0;width:auto}
  .fees-m-admin .panel > header .bar.tight .btn,.fees-m-report .panel > header .bar.tight .btn{flex:0 0 auto}
  .fees-m-admin .picklist .pickrow{min-height:48px}
  .fees-m-admin .picklist .pickrow > .grow{min-width:0;overflow-wrap:anywhere}
  .fees-m-genmonth{flex-wrap:wrap}
  .fees-m-genmonth input[type=date]{flex:1 1 100%;width:100%!important}
}
