/* Phone layout (< 744px) for the admin screens — see the mobile handoff. */
@media (max-width:743.98px){
  /* ---- a filter card with "More filters · n" (reports, org chart, audit) */
  .adm-bar > .mmore-link{grid-column:1 / -1;justify-self:start;min-height:44px;padding:0 2px;
    font-size:14px;font-weight:600;color:#0E7A63;text-decoration:none}
  .adm-bar > .mmore{grid-column:1 / -1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .adm-bar > .mmore[hidden]{display:none}
  .adm-bar > .mmore > .inline-field{min-width:0}
  .adm-bar > .bar.tight{grid-column:1 / -1}
  .adm-bar > .bar.tight > .btn{flex:1 1 auto}
  .adm-bar .inline-field input,.adm-bar .mpick{width:100% !important;min-width:0 !important}
  .adm-bar .mpick-sum{min-height:48px;display:flex;align-items:center;padding:0 30px 0 12px;
    border-radius:12px;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .adm-bar .mpick-opt{min-height:44px;font-size:15px}
  .adm-one{grid-template-columns:minmax(0,1fr)}

  /* ---- a button on a list row itself (Password resets' Reset) */
  .mrow > .adm-rowbtn{flex:none;min-height:44px;min-width:72px}

  /* ---- reports: the picker across, the exports a row of equal buttons */
  .adm-reptop > *{grid-column:1 / -1}
  .adm-reptop > .grow{display:none}
  .adm-reptop > .btnrow{display:flex;flex-wrap:wrap;gap:8px}
  .adm-reptop > .btnrow > .btn{flex:1 1 0;min-width:0}
  /* a report row, every column, in its sheet */
  .adm-kv{background:var(--surface);border:1px solid #E5EAE6;border-radius:16px;padding:4px 14px}
  .adm-kv-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;
    padding:10px 0;border-top:1px solid #EDF0EC;font-size:15px;min-width:0}
  .adm-kv-row:first-child{border-top:0}
  .adm-kv-k{flex:none;max-width:45%;font-family:var(--mono);font-size:12px;letter-spacing:.04em;
    text-transform:uppercase;color:#5C6D64}
  .adm-kv-v{min-width:0;text-align:end;overflow-wrap:anywhere;color:#16211C}

  /* ---- organisation chart: Find across, the chart's buttons a full row,
     the chart a pan/zoom box of its own that never widens the page */
  .adm-bar > .inline-field:has(input[type=search]){grid-column:1 / -1}
  .adm-bar > .collapsetools{grid-column:1 / -1;display:flex;gap:8px}
  .adm-bar > .collapsetools .btn{flex:1 1 0;min-width:0;min-height:44px;font-size:14px;padding:0 8px}
  .adm-orgbox{margin-top:12px;border:1px solid #E5EAE6;border-radius:16px;background:var(--surface);
    max-width:100%}
  .adm-orgbox > .empty{padding:24px 14px;text-align:center}
  .rostergrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rostercard-name{font-size:14px;min-height:44px}
  .rostercard-code,.rostercard-stats{font-size:12px}

  /* ---- roll number cards: the print settings and verbs, a line each */
  .adm-rollopts{margin-top:12px}
  .adm-rollopts > .inline-field:nth-child(3),
  .adm-rollopts > .check,.adm-rollopts > .btn{grid-column:1 / -1}
  .adm-rollopts .inline-field input{width:100% !important}
  .adm-rollopts > .inline-field:nth-child(2) > span.dim{display:flex;align-items:center;min-height:48px;
    padding:0 !important}
  .adm-rollopts > .check{display:flex;align-items:flex-start;gap:10px;min-height:44px;font-size:15px;
    line-height:1.35;padding:4px 0}
  .adm-rollopts > .check input{flex:none;width:22px;height:22px;margin:0}
  .adm-oncard{display:inline-flex;align-items:center;gap:6px;font-size:13px}
  .adm-oncard .pill{font-size:12px}

  /* ---- School: one column, fields across, Save full width */
  .schoolmaster{flex-direction:column;align-items:stretch;gap:16px;padding:14px}
  .schoolmaster .grow{min-width:0;display:flex;flex-direction:column;gap:12px}
  .schoolmaster .field > input{width:100%;height:48px;font-size:16px}
  .schoolmaster .bar{display:block;background:none;border:0;border-radius:0;padding:0}
  .schoolmaster .bar .btn{width:100%;min-height:48px}

  /* ---- Messages: each one a list row — subject and time, two lines of it,
     the rest when tapped */
  .msglist{padding:0}
  .msglist > .adm-msg{min-height:64px;padding:12px 14px;border-bottom:1px solid #EDF0EC;cursor:pointer;
    -webkit-tap-highlight-color:transparent}
  .msglist > .adm-msg:active{background:#F7FAF7}
  .adm-msg .msg-head{flex-wrap:wrap;gap:4px 8px;font-size:14px;min-width:0}
  .adm-msg .msg-head > strong{flex:1 1 60%;min-width:0;font-size:16px;font-weight:600;color:#16211C;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .adm-msg .msg-head > .spacer{display:none}
  .adm-msg .msg-head > .dim.mono{flex:none;font-size:12px;color:#5C6D64}
  .adm-msg .msg-head > .pill{font-size:12px}
  .adm-msg.unread .msg-head > strong::before{content:'';display:inline-block;width:8px;height:8px;
    margin-right:8px;border-radius:50%;background:#0E7A63;vertical-align:middle}
  .adm-msg .msg-body{font-size:14px;color:#5C6D64;line-height:1.4;display:-webkit-box;
    -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
  .adm-msg.adm-open .msg-body{display:block;-webkit-line-clamp:unset;color:#16211C;font-size:15px}
  .adm-msg .msg-link{font-size:13px;min-height:44px;display:inline-flex;align-items:center}
  .adm-msg .filegrid{margin-top:8px}
  /* New message: the "Send to" dropdown where the tabs were */
  .adm-sendto{display:block}
  .adm-sendto > .inline-field{display:flex;flex-direction:column;gap:5px;width:100%}

  /* ---- Academic year: transitions a full-width button each; the promote
     sheet's class headers wrap rather than run off the side */
  .adm-stack{flex-direction:column;align-items:stretch}
  .adm-stack > .btn{width:100%;white-space:normal;min-height:48px}
  .adm-promote .assign-head{flex-wrap:wrap;gap:8px;padding:8px 10px}
  .adm-promote .assign-head > .spacer{display:none}
  .adm-promote .assign-head > .combo{flex:1 1 160px;width:auto !important;min-width:0}
  .adm-promote .assign-head > .linkbtn{min-height:44px}
  .adm-promote .rosterrow{min-height:44px;display:flex;align-items:center;gap:10px}
  .adm-promote .rosterbox{max-width:100%;overflow-x:hidden}

  /* ---- Audit log: an entry is a list row — what was done on the first
     line, what changed under it, when and who last; open, its details */
  .adm-audit .auditrow summary{position:relative;flex-wrap:wrap;align-items:center;gap:4px 8px;
    min-height:64px;padding:12px 40px 12px 14px;cursor:pointer}
  .adm-audit .auditrow summary::after{content:'';position:absolute;right:16px;top:50%;width:8px;height:8px;
    margin-top:-6px;border-right:2px solid #8A988F;border-bottom:2px solid #8A988F;transform:rotate(-45deg)}
  .adm-audit .auditrow[open] > summary::after{transform:rotate(45deg)}
  .adm-audit .auditrow summary > .auditact{order:1;font-size:12px}
  .adm-audit .auditrow summary > .auditwhat{order:2;font-size:16px;font-weight:600;color:#16211C;
    min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .adm-audit .auditrow summary > .auditlabel{order:3;font-size:15px;max-width:100%}
  .adm-audit .auditrow summary > .auditsum{order:4;width:100%;font-size:14px;color:#5C6D64}
  .adm-audit .auditrow summary > .auditwhen{order:5;min-width:0;font-size:12px}
  .adm-audit .auditrow summary > .auditwho{order:6;font-size:13px;min-width:0;max-width:100%;
    overflow:hidden;text-overflow:ellipsis}
  .adm-audit .auditrow summary > .spacer{display:none}
  .adm-audit .auditgroup-rows{padding:4px 0 8px 8px}
  .adm-audit .auditgroup-rows .auditrow summary{padding:10px 36px 10px 10px;min-height:56px}
  .adm-audit .auditdetail{padding:12px 10px 14px}
  .adm-audit .auditdetail .tablewrap.stack{overflow:visible}
  .adm-audit .auditdetail .bar.tight .btn{min-height:44px;width:100%}
  .adm-audit .auditmore{flex-wrap:wrap}
  .adm-audit .auditmore .btn{min-height:44px}

  /* ---- Roles & access: the permission editor one group to a row, codes
     wrapping rather than widening the sheet */
  .permgrid{grid-template-columns:minmax(0,1fr)}
  .permrow{min-height:44px;padding-block:10px}
  .permrow input{width:22px;height:22px}
  .permname{font-size:15px}
  .permcode,.permopens{font-size:12px;overflow-wrap:anywhere}
}
