/* Light, native-feeling working app: grouped white lists on system grey, the device's own font,
   one teal tint for actions. Phone: bottom tabs. Desktop (900px+): a sidebar and wider screens. */
:root{
  --bg:#f2f2f7; --surface:#ffffff; --ink:#1c1c1e; --muted:#636366; --line:#e5e5ea;
  --fill:#ececf0; --field:#f2f2f7; --search:#e3e3e8; --seg-on:#ffffff;
  --accent:#0b6e5f; --accent-ink:#ffffff; --accent-soft:#e3f2ef;
  --good:#1f7a46; --good-soft:#e2f3e8; --warn:#9a5a00; --warn-soft:#fdf0d9; --bad:#c4312b; --bad-soft:#fde4e2; --bad-ink:#ffffff;
  --bar:rgb(249 249 249 / .92); --scrim:rgb(0 0 0 / .32); --shadow:0 10px 32px rgb(0 0 0 / .14); --lift:0 1px 3px rgb(0 0 0 / .12);
  --toast:#1c1c1e; --toast-ink:#ffffff; --gold:#e9b44c;
  --font:-apple-system,system-ui,"SF Arabic","Segoe UI","Noto Sans Arabic",Tahoma,sans-serif;
  --r:12px; --side:232px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){ :root{
  --bg:#000000; --surface:#1c1c1e; --ink:#f2f2f7; --muted:#a1a1a6; --line:#38383a;
  --fill:#2c2c2e; --field:#2c2c2e; --search:#1c1c1e; --seg-on:#636366;
  --accent:#3ec2aa; --accent-ink:#00241e; --accent-soft:#0f2e29;
  --good:#4fd18b; --good-soft:#123222; --warn:#f2b54a; --warn-soft:#3a2a0e; --bad:#ff6961; --bad-soft:#3d1513; --bad-ink:#2a0606;
  --bar:rgb(22 22 24 / .9); --scrim:rgb(0 0 0 / .55); --shadow:0 10px 32px rgb(0 0 0 / .5); --lift:0 1px 3px rgb(0 0 0 / .4);
  --toast:#f2f2f7; --toast-ink:#1c1c1e; --gold:#f0bf5c;
  color-scheme:dark } }

*{box-sizing:border-box}
html,body{margin:0}
/* No double-tap zoom on touch screens (pinch zoom still works). */
html{touch-action:manipulation}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:16px;line-height:1.45;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
::selection{background:var(--accent-soft);color:var(--ink)}
[hidden]{display:none!important}
.app{max-width:760px;margin:0 auto;padding-inline:16px;padding-block:max(8px,env(safe-area-inset-top)) calc(96px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:16px}
h1{font-size:17px;margin:0;font-weight:600}
h2{font-size:28px;margin:0;font-weight:700;line-height:1.2}
h3{font-size:13px;margin:0;font-weight:400;color:var(--muted)}
.num{font-variant-numeric:tabular-nums;unicode-bidi:isolate;white-space:nowrap}
.muted{color:var(--muted)} .small{font-size:13px}
.stack{display:flex;flex-direction:column;gap:20px}

/* top bar: wordmark (large on Home, like a large title) and the account button */
header.top{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:44px}
/* logo: wordmark in the text colour, mark in teal and gold */
.logo-defs{position:absolute;width:0;height:0;overflow:hidden}
.lg-a{fill:var(--accent)} .lg-b{fill:var(--gold)}
.logo{display:block;height:24px;width:auto;color:var(--ink)}
header.top h1{line-height:0}
body[data-view="home"] header.top .logo{height:36px}

/* ---- navigation: bottom tab bar on phones ---- */
nav{position:fixed;inset-inline:0;bottom:0;background:var(--bar);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-top:.5px solid var(--line);display:flex;justify-content:center;padding-bottom:env(safe-area-inset-bottom,0px);z-index:5}
nav .nav-brand,nav .nav-account,nav .nav-biz{display:none}
nav button{flex:1;max-width:120px;min-width:0;background:none;border:0;padding:7px 2px 6px;font:inherit;font-size:11px;line-height:1.3;font-weight:500;color:var(--muted);cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:3px}
nav button svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
nav button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
nav button[aria-current="true"]{color:var(--accent)}

/* ---- controls ---- */
button,input,select,textarea{font:inherit;color:inherit}
.ico{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ico circle{fill:currentColor;stroke:none}
.btn.sm .ico{width:16px;height:16px}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.btn{appearance:none;border:0;background:var(--surface);color:var(--accent);border-radius:10px;padding:7px 14px;min-height:36px;cursor:pointer;font-weight:600;font-size:15px;display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;white-space:nowrap}
.panel .btn,dialog .btn,.stat .btn{background:var(--fill)}
.btn.primary{background:var(--accent);color:var(--accent-ink)}
.btn.sm{min-height:30px;padding:4px 12px;font-size:14px;border-radius:8px}
.btn.danger{color:var(--bad)}
/* The one button that really deletes something: only in the confirm dialog. */
.btn.danger-fill{background:var(--bad);color:var(--bad-ink)}
.btn[aria-busy="true"]{opacity:.6;cursor:progress}
.btn:disabled{opacity:.4;cursor:default}
@media (hover:hover){.btn:hover:not(:disabled){filter:brightness(.96)} .btn.primary:hover:not(:disabled){filter:brightness(1.08)}}
/* "→ رجوع" style links at the top of a page read as a plain back link */
.app>section>.btn.sm:first-child{background:none;padding-inline:0;font-size:17px;font-weight:400;min-height:32px}
/* 16px text in every field: iPhones zoom in on fields with smaller text. */
input,select,textarea{background:var(--surface);border:0;box-shadow:inset 0 0 0 1px var(--line);border-radius:10px;padding:8px 12px;min-height:40px;width:100%;min-width:0;font-size:16px}
/* iPhones draw date fields natively and taller than the rest; make them a plain field like the others. */
input[type="date"]{-webkit-appearance:none;appearance:none;display:block;line-height:1.25}
input[type="date"]::-webkit-date-and-time-value{text-align:start;margin:0}
dialog input,dialog select,dialog textarea{background:var(--field);box-shadow:none}
input[type="search"]{background:var(--search);box-shadow:none}
input::placeholder{color:var(--muted)}
label{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--muted);min-width:0}
label.check{flex-direction:row;align-items:center;gap:8px;white-space:nowrap;font-size:15px;color:var(--ink)}
label.check input{width:20px;height:20px;min-height:0;accent-color:var(--accent)}
label.inline{flex-direction:row;align-items:center;gap:8px;white-space:nowrap}
label.inline select{width:auto}
.ink-link{color:inherit;text-decoration:none}
.ink-link:hover{text-decoration:underline;text-underline-offset:3px}

/* page header: large title on its own line, then search and actions */
.bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.bar>h2{flex-basis:100%}
.bar .grow{flex:1;min-width:160px}

/* ---- grouped lists: a muted header above a white rounded group with inset hairlines ---- */
.panel{display:flex;flex-direction:column}
.panel>*:not(h3){background-color:var(--surface)}
.panel>h3{padding:0 16px 6px}
.panel>:first-child:not(h3),.panel>h3+*{border-start-start-radius:var(--r);border-start-end-radius:var(--r)}
.panel>:last-child{border-end-start-radius:var(--r);border-end-end-radius:var(--r)}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:11px 16px;min-height:52px;color:inherit;text-decoration:none}
.panel>.row+.row,.panel>.row+.more,.panel>.row+.panel-note,.panel>.chart+.tbl-wrap{background-image:linear-gradient(var(--line),var(--line));background-size:calc(100% - 16px) 1px;background-repeat:no-repeat;background-position:left top}
.row .main{flex:1;min-width:150px}
.row .main strong{font-weight:500}
.row .amt{font-weight:600;text-align:end;font-variant-numeric:tabular-nums}
.row.click,.orow[data-href],.prow[data-href]{cursor:pointer}
@media (hover:hover){.row.click:hover,.orow[data-href]:hover,.prow[data-href]:hover{background-color:var(--fill)}}
.row.click:active,.orow[data-href]:active{background-color:var(--fill)}
.row.spent{opacity:.55}
.acts{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.empty{padding:24px 16px;color:var(--muted);text-align:center}
.more{display:flex;justify-content:center;padding:10px}
.panel-note{margin:0;padding:10px 16px}
.total-row{font-weight:600}
.two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:20px;align-items:start}
.two.wide{grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr))}
.list-sum{margin:0 16px}

/* orders: a muted heading per day, and statement-style rows: name and reference, status word, amount */
.panel>.day{background-color:transparent;padding:14px 16px 6px;font-size:13px;color:var(--muted)}
.panel>.day:first-child{padding-top:0}
.panel>.day+.row{border-start-start-radius:var(--r);border-start-end-radius:var(--r)}
.panel>.row:has(+.day){border-end-start-radius:var(--r);border-end-end-radius:var(--r)}
.orow{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"main amt" "main st" "acts acts";column-gap:12px;row-gap:2px;align-items:center}
.orow .main{grid-area:main;min-width:0}
.orow .main strong{font-size:16px}
.orow .st{grid-area:st;justify-self:end}
.orow .amt{grid-area:amt;font-size:16px}
.orow .acts{margin-top:6px}
.amt .d{font-size:12px;font-weight:400;color:var(--muted)}
.orow .acts{grid-area:acts;justify-content:flex-end}
.items{font-size:13px;color:var(--muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.items b{font-weight:500}
.items .sep{color:var(--muted)}
@media (min-width:700px){
  .orow{grid-template-columns:minmax(0,1fr) 130px 100px 170px;grid-template-areas:"main st amt acts"}
  .orow .st{justify-self:start}
  .orow .acts{margin-top:0}
  .orow.compact{grid-template-columns:minmax(0,1fr) 130px 100px;grid-template-areas:"main st amt"}
}
.summary{display:flex;gap:8px;align-items:center;margin-bottom:12px}

/* status as a coloured word, and small tags */
.st{font-size:14px;font-weight:500;white-space:nowrap}
.st.good{color:var(--good)} .st.warn{color:var(--warn)} .st.bad{color:var(--bad)}
.pill{display:inline-block;border-radius:6px;padding:1px 8px;font-size:13px;font-weight:500;white-space:nowrap;background:var(--fill);color:var(--ink)}
.pill.good{background:var(--good-soft);color:var(--good)}
.pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.bad{background:var(--bad-soft);color:var(--bad)}
.pill.plain{background:var(--fill);color:var(--muted)}
.chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.bad-ink{color:var(--bad)} .good-ink{color:var(--good)} .warn-ink{color:var(--warn)}
.vars{font-size:14px;margin-top:4px;line-height:1.6}
.vars>span:not(.sep){display:inline-block}
.vars b{font-weight:600;font-variant-numeric:tabular-nums}
.vars .sep{color:var(--muted)}
.title-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* figures */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;background:var(--line);border-radius:var(--r);overflow:hidden}
.stat{background:var(--surface);border:0;border-radius:0;padding:12px 16px;display:flex;flex-direction:column;gap:2px;text-align:start}
.stat b{font-size:22px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.25}
.stat .sub{font-size:13px;color:var(--muted)}
.stat.owed b{color:var(--bad)} .stat.pos b{color:var(--good)} .stat.neg b{color:var(--bad)}
.stat.hero b{font-size:30px}
.stat .b-text{font-size:17px;padding-top:4px}
.stats.four{grid-template-columns:repeat(2,minmax(0,1fr))}
.stats.three{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:480px){.stats.three .stat{padding:10px 12px}.stats.three b{font-size:18px}}
button.stat{font:inherit;color:inherit;cursor:pointer}
@media (hover:hover){button.stat:hover{background:var(--fill)}}

/* home */
.home-top,.home-lead{display:flex;flex-direction:column;gap:12px}
.home-top{gap:20px}
.hero-card{background:var(--surface);border-radius:16px;padding:20px 16px 18px;text-align:center;display:flex;flex-direction:column;gap:2px}
.hero-card b{font-size:42px;font-weight:700;line-height:1.15;font-variant-numeric:tabular-nums}
.actions{display:flex;gap:8px}
.actions .btn{flex:1;min-height:44px;border-radius:12px;padding-inline:10px}
.actions .btn.primary{flex:2}
.sec-head{display:flex;justify-content:space-between;align-items:baseline;padding:0 16px 6px}
.sec-head h3{padding:0}
.link{background:none;border:0;padding:0;color:var(--accent);font:inherit;font-size:15px;cursor:pointer;text-decoration:none}

.note{background:var(--warn-soft);color:var(--warn);border-radius:var(--r);padding:12px 16px}
.info{background:var(--accent-soft);border-radius:var(--r);padding:12px 16px}
.err{color:var(--bad);margin:0;font-size:14px}

/* segmented control (report periods) */
.seg{display:flex;flex-wrap:nowrap;width:100%;max-width:560px;background:var(--fill);border-radius:9px;padding:2px;gap:2px}
.seg button{flex:1 1 0;min-width:0;white-space:nowrap;padding-inline:6px;background:none;border:0;border-radius:7px;padding:5px 12px;min-height:30px;cursor:pointer;font-weight:500;font-size:14px;color:var(--ink)}
.seg button[aria-pressed="true"]{background:var(--seg-on);box-shadow:var(--lift);font-weight:600}

/* "⋯" menus */
.menu{position:relative}
.menu>summary{list-style:none}
.menu>summary::-webkit-details-marker{display:none}
.menu-list{position:absolute;inset-inline-end:0;top:calc(100% + 6px);z-index:3;background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow);padding:6px;white-space:nowrap;display:flex;flex-direction:column;gap:4px}

/* login */
.login{max-width:380px;margin:14vh auto 0;padding-inline:16px;display:flex;flex-direction:column;gap:16px}
.login h1{line-height:0;display:flex;justify-content:center;margin-bottom:8px}
.login .logo{height:58px}
.login form{background:var(--surface);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:14px}
.login .btn{min-height:44px}

/* dialogs: centred sheet; on phones it rises from the bottom, near the thumb */
dialog{background:var(--surface);color:var(--ink);border:0;border-radius:14px;padding:0;width:min(560px,calc(100vw - 32px));max-height:calc(100% - 32px);box-shadow:var(--shadow)}
dialog::backdrop{background:var(--scrim)}
dialog form{display:flex;flex-direction:column;gap:14px;padding:20px}
#dlgTitle{font-size:17px;font-weight:600;text-align:center}
#cf{width:min(340px,calc(100vw - 48px));text-align:center}
#cf .foot{justify-content:center}
#cf .btn{flex:1}
.fbody{display:flex;flex-direction:column;gap:12px}
.fbody h3{padding-top:4px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.line{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,1fr) minmax(0,1.2fr) auto;gap:6px;align-items:end}
.inrow{display:flex;gap:6px;align-items:end}
.inrow .grow{flex:1}
#o-cust-hint:empty{display:none}
.vline{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1.4fr) minmax(0,1fr) auto;gap:6px;align-items:end}
.foot{display:flex;gap:8px;justify-content:flex-start;flex-wrap:wrap}
dialog form>.foot:last-child .btn{min-width:110px;min-height:44px}
.total{display:flex;justify-content:space-between;font-weight:600;font-size:18px;border-top:1px solid var(--line);padding-top:12px}
.date-hint{color:var(--muted);font-size:12px;line-height:1.4;min-height:1.4em}
@media (max-width:600px){
  #dlg{margin:auto 0 0;width:100%;max-width:100%;max-height:92dvh;border-radius:14px 14px 0 0}
  #dlg form{padding-top:8px;padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
  #dlg form::before{content:"";align-self:center;width:36px;height:5px;border-radius:3px;background:var(--line);margin-bottom:2px}
  #dlg form>.foot:last-child .btn{flex:1}
}

/* toast with an undo button */
#toast{position:fixed;bottom:calc(84px + env(safe-area-inset-bottom,0px));inset-inline:16px;margin:auto;max-width:380px;background:var(--toast);color:var(--toast-ink);border-radius:14px;padding:12px 16px;text-align:center;z-index:20;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;gap:12px;font-size:15px}
.toast-act{background:none;border:0;color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:4px 6px}

@media (max-width:480px){
  /* five periods don't fit a phone's width: the control scrolls sideways instead of squeezing */
  .seg{overflow-x:auto;scrollbar-width:none}
  .seg::-webkit-scrollbar{display:none}
  .seg button{flex:1 0 auto;font-size:13px;padding-inline:10px}
  .grid2{grid-template-columns:1fr}
  /* order line: the item picker gets its own full-width row */
  .line{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto}
  .line>label:first-child{grid-column:1/-1}
}
/* Touch screens: finger-sized targets, and 16px fields so iOS doesn't zoom in on focus. */
@media (pointer:coarse){
  .btn{min-height:44px} .btn.sm{min-height:40px;padding-inline:14px}
  input,select{min-height:44px;font-size:16px}
  label.check input{min-height:0}
  .seg button{min-height:40px}
  .toast-act{min-height:44px;padding-inline:10px}
}

/* loading placeholders */
.sk{display:block;height:11px;border-radius:6px;background:var(--fill);margin:5px 0;animation:sk 1s ease-in-out infinite alternate}
.sk.w40{width:40%} .sk.w70{width:70%} .sk.w15{width:56px}
@keyframes sk{from{opacity:.5}to{opacity:1}}

/* stock: on a phone the buttons go under the product details */
@media (max-width:600px){.prow .main{flex-basis:100%}}

/* customer list tiles */
.ctile{flex-wrap:nowrap;gap:12px;min-height:64px}
.ctile .main{min-width:0;flex:1}
.avatar{flex:none;width:40px;height:40px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:600;font-size:17px}
.cname{display:block;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.csub{line-height:1.5}
.bal{flex:none;display:flex;flex-direction:column;align-items:flex-end;line-height:1.3;font-size:12px;color:var(--muted)}
.bal b{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}
.bal.owes b{color:var(--bad)} .bal.credit b{color:var(--good)}
.chev{flex:none;color:var(--muted);display:inline-flex;opacity:.7}
.chev .ico{width:16px;height:16px}
.contact{gap:8px}

/* expenses */
.month-nav{display:flex;align-items:center;gap:8px}
.month-nav strong{min-width:130px;text-align:center;font-weight:600}
.share-row{display:grid;grid-template-columns:minmax(90px,1.2fr) 2fr 44px 84px;align-items:center}
.share-row .main{min-width:0}
.share{display:block;height:6px;background:var(--fill);border-radius:3px;overflow:hidden}
.share i{display:block;height:100%;background:var(--accent);border-radius:3px}
.pct{text-align:end}

/* reports */
.group{display:flex;flex-direction:column;gap:8px}
.sec{font-size:20px;font-weight:700;color:var(--ink);padding:0}
.chart{position:relative;padding:12px 8px 4px}
.chart svg{display:block;direction:ltr;max-width:100%}
.chart .cbar{fill:var(--accent);transition:opacity .12s}
.chart .cbar.dim{opacity:.35}
.chart .grid{stroke:var(--line);stroke-dasharray:3 3}
.chart .axis{stroke:var(--muted)}
.chart .tick{fill:var(--muted);font-size:11px;font-family:var(--font)}
.chart .hit{fill:transparent}
.tip{position:absolute;background:var(--surface);border-radius:10px;box-shadow:var(--shadow);padding:8px 12px;font-size:13px;line-height:1.5;pointer-events:none;white-space:nowrap;z-index:2}
.tbl-wrap>summary{padding:10px 16px;cursor:pointer;color:var(--accent);font-size:15px;list-style:none;display:flex;align-items:center;gap:6px}
.tbl-wrap>summary::-webkit-details-marker{display:none}
.tbl-wrap>summary .ico{width:16px;height:16px;transition:transform .15s}
.tbl-wrap[open]>summary .ico{transform:rotate(-90deg)}
.tbl{overflow-x:auto}
.tbl table{border-collapse:collapse;width:100%;min-width:520px;font-variant-numeric:tabular-nums}
.tbl th,.tbl td{padding:9px 16px;border-bottom:1px solid var(--line);text-align:start;white-space:nowrap}
.tbl th{font-size:13px;color:var(--muted);font-weight:500}

/* ---- desktop: a sidebar instead of the tab bar, and wider screens ---- */
@media (min-width:900px){
  nav{top:0;bottom:0;inset-inline-start:0;inset-inline-end:auto;width:var(--side);flex-direction:column;justify-content:flex-start;align-items:stretch;gap:2px;padding:20px 12px;background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none;border-top:0;border-inline-end:1px solid var(--line)}
  nav .nav-brand{display:block;padding:6px 12px 22px}
  nav .nav-brand .logo{height:30px}
  nav .nav-biz{display:flex;align-items:center;gap:10px;padding:0 12px 18px;font-weight:600;font-size:15px;color:var(--ink);min-width:0}
  nav .nav-biz span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  nav .nav-biz img{width:32px;height:32px;border-radius:8px;object-fit:contain;background:var(--fill);flex:none}
  nav .nav-account{display:flex;margin-top:auto;color:var(--muted)}
  nav .nav-account svg{color:var(--muted)}
  nav button{flex:none;max-width:none;flex-direction:row;gap:12px;padding:9px 12px;border-radius:10px;font-size:15px;color:var(--ink)}
  nav button svg{width:22px;height:22px;color:var(--accent)}
  nav button[aria-current="true"]{background:var(--accent-soft);color:var(--accent);font-weight:600}
  @media (hover:hover){nav button:hover:not([aria-current="true"]){background:var(--fill)}}
  .app{max-width:none;margin:0;margin-inline-start:var(--side);padding:20px 40px 48px}
  .app>*{width:100%;max-width:1040px;margin-inline:auto}
  header.top{display:none}
  .app{padding-top:32px}
  h2{font-size:30px}
  .stats.four{grid-template-columns:repeat(4,minmax(0,1fr))}
  /* debt card and actions beside this month's figures, both starting on one line and of equal height */
  .home-top:has(>section){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);grid-template-rows:auto 1fr;column-gap:20px;row-gap:0}
  .home-top>section{display:contents}
  .home-top>.home-lead{grid-column:1;grid-row:2}
  .home-top>section>.sec-head{grid-column:2;grid-row:1}
  .home-top>section>.stats{grid-column:2;grid-row:2;grid-template-columns:repeat(2,minmax(0,1fr))}
  .home-top .stat{justify-content:center}
  .home-lead .hero-card{flex:1;justify-content:center}
  .hero-card{padding:24px 16px 22px}
  .hero-card b{font-size:46px}
  #toast{bottom:24px;inset-inline-start:calc(var(--side) + 16px)}
  .bar .grow{max-width:420px}
}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---- the business: name and logo in the header, on the login screen and in its settings ---- */
.biz{flex:1;min-width:0;display:flex;align-items:center;gap:8px;font-weight:600;font-size:15px;color:var(--ink)}
.biz span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.biz img{width:28px;height:28px;border-radius:8px;object-fit:contain;background:var(--surface);flex:none}
.login-tenant{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.login-tenant img{width:72px;height:72px;border-radius:16px;object-fit:contain;background:var(--surface)}
.login-tenant strong{font-size:20px}
.biz-logo{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.biz-logo img{width:64px;height:64px;border-radius:12px;object-fit:contain;background:var(--fill)}
.biz-logo label.btn{flex-direction:row}

/* ---- platform admin page (admin.html) ---- */
body.admin nav{display:none}
.admin-title{font-size:26px;text-align:center;margin:0}
.admin-app{max-width:960px;margin:0 auto;padding:24px 16px 48px}
.log-sum{padding:12px 16px;cursor:pointer;color:var(--muted)}
/* phones: the business's logo and name get their own line under the app logo */
@media (max-width:899px){
  header.top{flex-wrap:wrap;row-gap:6px}
  header.top .biz{order:3;flex-basis:100%}
}
