/* Phone layout: trader users and trader admins work mostly on a phone. Loaded after login.css. */
.poweredBy{text-align:center;font-size:12px;color:var(--mid);padding:14px 8px 6px;margin:0}
.loginWrap .poweredBy{padding-top:6px}
input,select,textarea{font-size:16px}               /* stops iOS zooming into fields */
button,.buttonLink,.helpLink{min-height:44px}
/* 100vh is taller than the visible screen while the phone's address bar shows; dvh follows the visible height (older browsers keep 100vh from login.css) */
body,.loginWrap{min-height:100dvh}
@media(max-width:720px){
 /* on html, never on body: body must not become a scroll box that swallows the swipe (mobile scroll fix) */
 html{overscroll-behavior-y:none}
 .shell{padding:16px 14px 24px}
 .panel{padding:18px 16px;border-radius:16px}
 .notice{font-size:12px;padding:10px 12px}
 .buttonLink{display:inline-flex;align-items:center}
 /* sections move to a bottom bar, where a thumb reaches */
 .appShell{display:block;min-height:100dvh}
 .sidebar{position:fixed;left:0;right:0;bottom:0;top:auto;height:auto;z-index:20;padding:6px 6px calc(6px + env(safe-area-inset-bottom));border-top:1px solid #2a3c5a;overflow:visible}
 .sideBrand{display:none}
 #sideNav{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
 #sideNav::-webkit-scrollbar{display:none}
 .navItem{flex:1 0 auto;width:auto;min-width:84px;text-align:center;white-space:nowrap;padding:10px 12px;font-size:13px;min-height:44px}
 .appMain{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
 .topbar{position:sticky;top:0;flex-direction:column;align-items:stretch;gap:8px;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top))}
 .topbar h1{font-size:17px;line-height:1.25}
 .topbarRight{width:100%;gap:8px}
 .topbarRight select,.topbarRight .traderSearch input{width:100%;min-width:0;flex:1 1 100%}
 .topbarRight .traderSearch{flex-wrap:wrap}
 .topbarRight .traderSearch label{display:none}
 .tabs{padding:8px 10px 0;gap:4px;-webkit-overflow-scrolling:touch}
 .tab{padding:10px 12px;font-size:14px;min-height:44px}
 #views{padding:12px 10px 24px;gap:14px}
 #views .panel,.panel.adminPanel{padding:16px 14px}
 #views .adminForm{max-width:none}
 #views .inlineForm{flex-direction:column;align-items:stretch}
 #views .inlineForm input,#views .inlineForm select,#views .inlineForm button{width:100%;min-width:0;flex:1 1 auto}
 .flex{display:block}
 .pager{flex-wrap:wrap}
 .adminRow,.adminList button{min-height:48px}
 table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .docRow{display:flex;flex-wrap:wrap;gap:6px}
 .bulkRow input[type=checkbox]{width:24px;height:24px}
 h1{font-size:22px}
}
@media(max-width:720px){
 .topbar{display:grid;grid-template-columns:1fr auto;align-items:center}
 .topbar>div:first-child{min-width:0}.topbar .topbarRight{grid-column:1/-1}
 .helpLink{display:inline-flex;align-items:center;color:var(--brand);font-weight:650;text-decoration:none;padding:0 10px}
 #homeCards{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 #homeCards .card{padding:12px}
}
@media(max-width:720px){
 .appMain,#views,#views>*{min-width:0;max-width:100%}
 #views{grid-template-columns:minmax(0,1fr)}
 .homeParties,#homeTable{overflow-x:auto}
 /* clip hides sideways overflow without turning html/body into extra scroll boxes, so vertical scrolling and the sticky top bar keep working;
    browsers without clip fall back to hidden on html only, which the page scroller takes over */
 html{overflow-x:hidden;overflow-x:clip}
 body{overflow-x:clip}
 /* the CA top bar (trader search + picker) is ~270px tall: let it scroll away on phones instead of pinning a third of the screen */
 .topbar:has(#traderPicker:not([hidden])){position:static}
 #homeCards{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #homeCards .card{min-width:0;overflow-wrap:anywhere}
}
@media(max-width:380px){.navItem{min-width:72px;padding:10px 8px;font-size:12px}}
@media(display-mode:standalone){.helpLink,[data-install]{display:none}}

/* Trading (purchase challans, sale invoices, stock, receivable / payable): phone first */
.tradeForm{border:1px solid #dce0e8;border-radius:14px;padding:14px;margin:0 0 16px;background:#f7f9fc}
.tradeForm h3{margin:0 0 10px}
.tradeGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.tradeGrid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.tradeField{display:flex;flex-direction:column;gap:4px}
.tradeField label{font-weight:650;font-size:13px}
.tradeField input,.tradeField select{width:100%;min-height:44px;box-sizing:border-box}
.tradeTotal{font-weight:650;margin:10px 0;display:grid;gap:4px}
.tradeLots{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.tradeLines{display:grid;gap:10px;margin:10px 0}
.tradeLine{border:1px solid #dce0e8;border-radius:12px;padding:10px;background:#fff;display:grid;gap:6px}
.tradeCard{border:1px solid #dce0e8;border-radius:12px;padding:12px;margin:0 0 10px;background:#fff}
.tradeCard p{margin:4px 0}
.tradeCard summary{cursor:pointer;font-weight:650;min-height:32px}
.tradeCardHead{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;flex-wrap:wrap}
.tradeBadge{font-size:12px;font-weight:700;border-radius:999px;padding:3px 10px;background:#e8eef8;color:#1d4f9f;white-space:nowrap}
.tradeBadge.waiting{background:#fff4e0;color:#8a5300}
.tradeBadge.rejected,.tradeBadge.cancelled{background:#fdecec;color:#a12020}
@media(max-width:720px){.tradeGrid,.tradeGrid.three{grid-template-columns:1fr}.tradeForm{padding:12px}}
/* Rights and delegation */
.rightsCard{display:grid;gap:8px;text-align:left}
.rightsGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.rightToggle{display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:center;text-align:left;border:1px solid #b7beca;border-radius:10px;background:#fff;color:var(--ink);padding:8px 10px;margin:0;font-weight:600}
.rightToggle .mark{grid-row:1/3;font-size:18px;width:26px;height:26px;display:grid;place-items:center;border-radius:50%}
.rightToggle small{grid-column:2;color:var(--mid);font-weight:400}
.rightToggle.on{border-color:var(--brand);background:#eef4fd}.rightToggle.on .mark{background:var(--brand);color:#fff}
.rightToggle.off .mark{background:#e6e9ef;color:#6b7383}
@media(max-width:720px){.rightsGrid{grid-template-columns:1fr}}
.tradeUncertain input,.tradeUncertain select{border-color:#b47b0b;background:#fff8e9}
.tradeUncertain label::after{content:" · check this";color:#8a5300;font-weight:700}
