/* =====================================================================
   Owner round 16 (feedback from the TestFlight app): the app does not behave like a web page, the buttons follow one system, and the cards that
   repeat (collection units, cheques, the receipt sheet) read the same way every time. Loaded last. Values come from tokens.css.
   ===================================================================== */

/* ---------- 1. nothing is selectable in the app, except what people copy ---------- */
html.native-ios, html.native-ios body, html.native-ios *{
  -webkit-user-select:none; user-select:none;
  -webkit-touch-callout:none;                       /* no Copy / Look Up / Translate callout, no link preview on a long press */
  -webkit-tap-highlight-color:transparent;
}
html.native-ios img, html.native-ios svg, html.native-ios canvas{ -webkit-user-drag:none }
/* a field must stay selectable (WebKit will not focus one under a user-select:none ancestor), and so must the values people copy: codes, keys, numbers */
html.native-ios :is(input, textarea, select, [contenteditable="true"], [contenteditable=""], .code, .sel, .rcno, .recovery li, .totp-secret){
  -webkit-user-select:text; user-select:text; -webkit-touch-callout:default;
}
html.native-ios :is(input, textarea, [contenteditable="true"]){ -webkit-touch-callout:default }
/* no double-tap zoom and no 300 ms wait on a chart, a card or a row (the viewport is locked in the app as well) */
html.native-ios, html.native-ios body{ touch-action:manipulation }

/* ---------- 2. the receipt sheet: one big action, a tidy pair beneath it, Cancel receipt apart and quiet ---------- */
.rc-actions{ display:flex; flex-direction:column; gap:12px; margin-top:16px }
.rc-main{ width:100%; min-height:calc(52px * var(--dt,1)); font-size:calc(16.5px * var(--dt,1)) }
.rc-main svg, .rc-grid .btn svg{ width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round }
.rc-main, .rc-grid .btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; text-align:center; white-space:normal; line-height:1.2 }
.rc-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px }
.rc-grid .btn{ min-height:calc(48px * var(--dt,1)); padding:8px 12px; font-size:calc(14.5px * var(--dt,1)) }
.rc-grid > :last-child:nth-child(odd){ grid-column:1 / -1 }   /* an odd one out takes the whole row */
.rc-saved{ grid-column:1 / -1; justify-self:center }
/* Cancel receipt: a quiet red line apart from the others, never a pill among them */
.rc-actions .rc-cancel, .rc-actions .rc-cancel:hover, html:root .modal .rc-actions .btn.rc-cancel, html:root .modal .rc-actions .btn.rc-cancel:hover{ align-self:center; margin-top:8px; min-height:calc(44px * var(--dt,1)); color:var(--bad-ink); background:transparent; box-shadow:none; border-color:transparent; -webkit-backdrop-filter:none; backdrop-filter:none }

/* ---------- 3 + 4. a collection card: the same rows, in the same order, in every state ----------
   who and the status / where (one line) / how much / what was paid / contract end and Call / the one action (Collect) and Receipt */
/* the money action is green in every company: green already means money in here (Collected, the progress bars), and a company's brown or red brand would read as a warning on it (white text on it: 5.5:1 light, 4.6:1 dark) */
html:root{ --collect:#0F7A55 }
@media (prefers-color-scheme: dark){ html:root{ --collect:#158559 } }
html:root[data-company-dark="true"]{ --collect:#158559 }
html:root .ucard.cc{ display:flex; flex-direction:column; align-items:stretch; gap:6px; padding:14px 16px; border-inline-start:0 }
html:root .ucard.cc > *{ margin:0; justify-self:auto; text-align:start }
html:root .ucard.cc .cc-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px }
html:root .ucard.cc .cc-top h4{ flex:1 1 auto; min-width:0; overflow-wrap:anywhere; line-height:1.3 }
html:root .ucard.cc .cc-top .tag{ flex:none; margin-top:1px }
.cc-where{ font-size:calc(13.5px * var(--dt,1)); color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.cc-where .cc-code{ font-size:calc(12px * var(--dt,1)); font-weight:500; color:var(--text-3); opacity:.85 }
html:root .ucard.cc .cc-amt{ display:flex; align-items:baseline; justify-content:space-between; gap:4px 10px; flex-wrap:wrap; justify-self:auto }
html:root .ucard.cc .cc-amt .rent{ font-size:calc(21px * var(--dt-cap,1)); font-weight:700; letter-spacing:-.01em; line-height:1.2 }
.cc-note{ font-size:calc(13px * var(--dt,1)); color:var(--text-3); margin-top:-2px }
.cc-pay, .cc-notes{ font-size:calc(13px * var(--dt,1)); line-height:1.4; color:var(--text-3) }
.cc-pay .num{ font-weight:500 }
.cc-notes{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden }
html:root .ucard.cc .cc-line{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0; font-size:calc(13px * var(--dt,1)) }
html:root .ucard.cc .cc-end{ white-space:normal; min-width:0; color:var(--text-3) }
html:root .ucard.cc .cc-line .callbtn{ margin-block:-6px; margin-inline-start:auto; flex:none; padding-block:4px }
html:root .ucard.cc .cc-act{ display:flex; gap:10px; margin-top:auto; padding-top:6px; align-items:stretch }   /* at the card's bottom, so the buttons of a row of cards line up on a tablet */
html:root .ucards:has(> .cc){ align-items:stretch }
html:root .ucard.cc .cc-act .btn{ min-height:calc(46px * var(--dt,1)); border-radius:100px; font-size:calc(15px * var(--dt,1)); font-weight:650; white-space:normal; line-height:1.2; display:inline-flex; align-items:center; justify-content:center; gap:8px }
html:root .ucard.cc .cc-main{ flex:1 1 auto; width:auto; margin:0; padding:0 18px }
html:root .ucard.cc .cc-main.go, html:root .ucard.cc .cc-main.go:hover{ background:var(--collect); color:#fff; border:0; box-shadow:none }
/* the month is fully collected (or nothing is due): the same button in the same place, calm */
html:root .ucard.cc .cc-main.calm, html:root .ucard.cc .cc-main.calm:hover, html:root .ucard.cc .cc-rcpt, html:root .ucard.cc .cc-rcpt:hover{
  background:transparent; color:var(--text-2); border:1.5px solid var(--line); box-shadow:none }
html:root .ucard.cc .cc-rcpt{ flex:none; padding:0 16px; font-weight:600 }
.cc-rcpt svg{ width:19px; height:19px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round }

/* ---------- 5. cheque status buttons: a grid with room for every word, never a word broken across two lines ---------- */
.chq-acts{ display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 9.5em), 1fr)); gap:8px; justify-content:stretch; width:100% }
.chq-acts .btn{ min-height:calc(44px * var(--dt,1)); padding:0 12px; white-space:normal; overflow-wrap:normal; word-break:keep-all; hyphens:none; text-align:center; line-height:1.2 }
.chq-acts > :last-child:nth-child(odd){ grid-column:1 / -1 }
@media(min-width:701px){ .chq-acts{ grid-template-columns:repeat(auto-fit, minmax(8em, max-content)); justify-content:end; width:auto } .chq-acts > :last-child:nth-child(odd){ grid-column:auto } }

/* ---------- 6. under the native bar: what scrolls beneath the title and the logo fades into the page, so the title never lands on a line of text ---------- */
html.native-ios.native-chrome:not(.native-sheet) body::before{
  content:""; position:fixed; inset-inline:0; top:0; height:calc(var(--safe-t, 0px) + 84px); z-index:4; pointer-events:none;
  background:linear-gradient(to bottom, var(--bg) 0, var(--bg) calc(var(--safe-t, 0px) + 58px), transparent 100%);
}

/* ---------- 7. one button system: one filled action (go / primary), secondary buttons outlined, destructive ones quiet red text, every one 44 pt or more ----------
   a plain button on a card is white on white in the light theme: it gets the same outline as the calm Collect button;
   an enquiry's card stands on the page with no panel around it, so it is named here as well ("Reply" was a white capsule on its white card) */
html:root :is(.panel, .ucard, .csum, .tw, .ecard, .lcard) .btn:not(.primary):not(.go):not(.danger):not(.text):not(.ghost):not(.calm):not(.cc-main):not(.cc-rcpt):not(.iconbtn){
  background:transparent; border-color:transparent; box-shadow:inset 0 0 0 1.5px var(--line); color:var(--text) }

/* the receipt picture: the sheet's width on a phone; on a tablet it stops at a readable width so the actions stay in view under it */
.rc-img{ display:block; width:100%; max-width:440px; margin:0 auto; border-radius:10px; border:1px solid var(--line-soft) }

/* =====================================================================
   Owner requests 2026-10-25 (markup by the AQARI agent): vacant units, Try the resident side, the tenant page
   ===================================================================== */

/* ---------- vacant units: a quiet list at the top of a property, each with its own Add tenant ---------- */
.vacant-panel > h3 small.num{ min-width:26px; padding:2px 9px; border-radius:100px; background:var(--c-primary-tint); color:var(--c-primary-ink); font-size:calc(12.5px * var(--dt,1)); font-weight:650; text-align:center }
.vu-list{ display:flex; flex-direction:column }
.vu-card{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-top:1px solid var(--line-soft) }
.vu-card:first-child{ border-top:0 }
.vu-info{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px }
.vu-info b{ font-size:calc(15.5px * var(--dt,1)); font-weight:650; line-height:1.3 }
.vu-info small{ font-size:calc(13px * var(--dt,1)); color:var(--text-3); line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.vu-card .btn{ flex:none; min-height:calc(44px * var(--dt,1)); padding:0 16px; font-weight:650 }
@media (max-width:360px){ .vu-card{ flex-wrap:wrap } .vu-card .btn{ flex:1 1 100% } }
/* the vacant unit's own page: what it is, how long, and the one action */
.vacant-panel.vu-unit .pbody{ padding:16px 18px 18px }
.vacant-panel.vu-unit b{ display:block; font-size:calc(17px * var(--dt,1)); font-weight:700; margin:0 0 4px }
.vacant-panel.vu-unit p.muted{ margin:0 0 14px; font-size:calc(13.5px * var(--dt,1)); line-height:1.45 }
.vacant-panel.vu-unit .btn.primary{ width:100%; min-height:calc(48px * var(--dt,1)); font-weight:650 }
@media (min-width:701px){ .vacant-panel.vu-unit .btn.primary{ width:auto; min-width:220px } }
/* the picker sheet when several units are vacant: one full-width row each */
button.setrow.vu-pick{ display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:calc(56px * var(--dt,1)); text-align:start; background:transparent; border:0; border-top:.5px solid var(--line); color:inherit; font:inherit; cursor:pointer }
button.setrow.vu-pick:first-of-type{ border-top:0 }
button.setrow.vu-pick .k{ flex:1 1 auto; min-width:0; overflow-wrap:anywhere }
button.setrow.vu-pick .v{ flex:none; color:var(--text-3); font-size:calc(22px * var(--dt-cap,1)); line-height:1; direction:ltr; unicode-bidi:bidi-override }
html[dir="rtl"] button.setrow.vu-pick .v{ transform:scaleX(-1) }
button.setrow.vu-pick:active{ background:var(--line-soft) }

/* ---------- Try the resident side (Company settings, owners): choose a lease, then two actions side by side ---------- */
#rtPanel .rt-actions{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; margin-top:12px }
#rtPanel .rt-actions .btn{ min-height:calc(48px * var(--dt,1)); padding:8px 12px; white-space:normal; line-height:1.2; text-align:center }
/* on a phone each action gets its own line: side by side "Preview as a resident" broke onto two lines */
@media (max-width:480px){ #rtPanel .rt-actions{ grid-template-columns:1fr } }
/* the steps under a test invitation: a soft box with numbers, room between lines */
.rt-steps{ margin:16px 0 0; padding:14px 18px 14px 20px; padding-inline:36px 18px; list-style:decimal; background:var(--surface-3); border-radius:14px; font-size:calc(14px * var(--dt,1)); line-height:1.5; color:var(--text-2) }
.rt-steps li{ padding-inline-start:4px; margin:0 0 8px }
.rt-steps li:last-child{ margin-bottom:0 }

/* ---------- the tenant page: Call first, who they are, then cards for each lease ---------- */
.tp-tools{ margin-bottom:12px }
.tp-tools .btn.primary{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:calc(52px * var(--dt,1)); font-size:calc(16px * var(--dt,1)); font-weight:650 }
@media (min-width:701px){ .tp-tools .btn.primary{ width:auto; min-width:260px } }
.tp-head .pbody{ padding:16px 18px }
.tp-head .tp-name{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin:0; padding:0; border:0; font-size:calc(22px * var(--dt-cap,1)); line-height:1.25; letter-spacing:-.01em }
.tp-head .tp-name .tag{ font-size:calc(12.5px * var(--dt,1)) }
.tp-head .ent-meta{ margin-top:6px; overflow-wrap:anywhere }
.tp-lease .ent-top{ align-items:flex-start }
.tp-lease .ent-top > span:first-child{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; min-width:0 }
.tp-lease .ent-top > span:first-child b{ flex:1 1 100%; font-size:calc(15.5px * var(--dt,1)) }
.tp-lease .ent-amt{ flex:none; white-space:nowrap }
.tp-lease .ent-act{ gap:10px; margin-top:12px }
.tp-lease .ent-act .btn{ min-height:calc(44px * var(--dt,1)); padding:0 16px; font-weight:600 }
.setrow.rev .v{ text-decoration:line-through }
@media (min-width:901px){ body[data-view="tenant"] .content{ max-width:760px } }

/* ---------- Licensing (markup by the AQARI agent): one list of every licence, status chips above it, a card each ---------- */
body[data-view="licensing"] .tools{ display:flex; align-items:center; gap:10px; flex-wrap:nowrap }
body[data-view="licensing"] .tools select{ flex:1 1 auto; min-width:0 }
body[data-view="licensing"] .tools .btn.primary{ flex:none; min-height:calc(44px * var(--dt,1)); padding:0 18px; font-weight:650 }
.lcsoon{ margin:0 0 12px; padding:10px 14px; border-radius:14px; background:var(--warn-tint); color:var(--warn-ink); font-size:calc(13.5px * var(--dt,1)); line-height:1.45; font-weight:500 }
#lcBox .cchips{ margin-bottom:12px }
#lcBox .ent{ padding:14px 16px }
#lcBox .ent-top{ align-items:flex-start; gap:12px }
#lcBox .ent-top > span:first-child{ min-width:0; overflow-wrap:anywhere }
#lcBox .ent-top b{ font-size:calc(15.5px * var(--dt,1)); font-weight:650; line-height:1.3 }
#lcBox .ent-top .tag{ flex:none }
#lcBox .ent-meta{ margin-top:6px; line-height:1.4; overflow-wrap:anywhere }
.lcnotes{ color:var(--text-2) !important; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden }
#lcBox .ent-act{ align-items:center; gap:10px; margin-top:12px }
#lcBox .ent-act .btn{ min-height:calc(44px * var(--dt,1)); padding:0 16px; font-weight:600 }
html:root #lcBox .ent-act [data-lcdel], html:root #lcBox .ent-act [data-lcdel]:hover{ margin-inline-start:auto; color:var(--bad-ink); background:transparent; box-shadow:none }
@media (min-width:901px){ body[data-view="licensing"] .content{ max-width:760px } }
.lcviewonly{ flex:none; margin-inline-start:auto; padding:6px 12px; font-size:calc(13px * var(--dt,1)) }   /* a reader without the switch: "View only" in place of Add licence */

/* ---------- Arabic month names under the small cashflow chart on a tablet: the Arabic chart is drawn wider (seven slots of 42 units, 311 in all, cashflow.js
   cfChart), so it is shown at 310 px and 12 units, about 12 px, or the names run into one another (seen on the iPad Overview, owner round 17) ---------- */
@media (min-width:641px){
  html[dir="rtl"] .cfmini{ flex:0 0 310px }
  html[dir="rtl"] .cfmini .dchart-svg text{ font-size:12px }
  html[dir="rtl"] .cfmini .cfsvg{ max-height:80px }
}

/* ---------- company colours (owner round 17: the awkward brown, red and yellow brands) ---------- */
/* the primary button's text follows the company colour it sits on: a light colour (yellow) carries the dark ink, not white (the iPhone app keeps its own navy button) */
html:root:not(.native-ios):not([data-company-dark="true"]) .content .btn.primary:not([aria-pressed]):not(.quiet-save), html:root:not(.native-ios):not([data-company-dark="true"]) .content .btn.primary:not([aria-pressed]):hover{ color:var(--c-accent-fg,#fff) }
/* the count inside a chosen chip is the chip's own text colour, a little softer, not the muted grey (it was 1.3:1 on a brown chip) */
html:root .chip.on :is(.muted, .num), html:root [aria-pressed="true"] :is(.muted, .num){ color:inherit; opacity:.85 }
/* "Invitation expired" and other red tags on the company's dark theme: the dark red text is unreadable on the dark card */
html[data-company-dark="true"] .tag.t-unpaid{ color:#FFB4A6 }

/* ---------- a phone on its side (owner round 17): the receipt picture and its actions sit side by side, so Share is in view without scrolling ---------- */
@media (orientation:landscape) and (max-height:520px){
  .modal .body:has(> .rc-actions){ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); column-gap:18px; align-items:start }
  .modal .body:has(> .rc-actions) > :not(.rc-img):not(.rc-actions){ grid-column:1 / -1 }
  .modal .body:has(> .rc-actions) > .rc-img{ grid-column:1; grid-row:2 / span 3; max-width:100% }
  .modal .body:has(> .rc-actions) > .rc-actions{ grid-column:2; margin-top:0 }
}

/* ---------- the accessibility text sizes (type-scale.js puts dt-ax on <html> from 1.5 times the usual size) ----------
   What sits side by side at the usual sizes stacks here, and a line that is cut with dots there wraps here: at twice the size a phone holds about
   twenty letters across, so a name, its status and its unit code cannot share one line. Nothing below changes a screen at the usual sizes. */
/* a Collection card: the status goes under the name, the place and its code wrap, the end date sits above the Call capsule */
html.dt-ax:root .ucard.cc .cc-top{ flex-wrap:wrap; row-gap:6px }
html.dt-ax:root .ucard.cc .cc-top h4{ flex:1 1 0; min-width:calc(100% - 54px); flex-wrap:wrap }   /* the rest of the line after the 42 px initials; a long name goes under the unit's code, whole words */
html.dt-ax:root .cc-where{ white-space:normal; overflow:visible }
html.dt-ax:root .ucard.cc .cc-line{ flex-wrap:wrap; row-gap:10px }
html.dt-ax:root .ucard.cc .cc-line .callbtn{ margin-inline-start:0; margin-block:0; max-width:100%; flex:0 1 auto; flex-wrap:wrap }
/* a plain card's heading (Tenants, Enquiries, Requests): the name has the first line to itself, the tags follow under it */
html.dt-ax:root .ucard:not(.cc) h4{ flex-wrap:wrap }
html.dt-ax:root .ucard:not(.cc) h4 > span:first-child{ flex:1 1 100% !important }   /* the screens write flex:1 on the name itself, which a rule without this cannot move */
html.dt-ax:root .tag{ white-space:normal }
/* a search box and the choice beside it: one under the other, each the full width */
html.dt-ax:root .tools > input[type="text"], html.dt-ax:root .tools > input[type="search"], html.dt-ax:root .tools > select{ flex:1 1 100%; min-width:0 }
/* Finance's tabs: rows of two whole names, never "Cas hflo w" and never a strip to slide at these sizes */
html.dt-ax:root .fintabs{ flex-wrap:wrap; border-radius:22px }
html.dt-ax:root .fintab{ flex:1 1 40%; overflow-wrap:normal; border-radius:18px; white-space:normal; min-width:0 }
/* Properties: one picture across on a phone, so "12 units · 1 vacant" stays inside its picture; the three figures two across, each label whole */
html.dt-ax:root .plist{ grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)) }
html.dt-ax:root .ptiles{ grid-template-columns:repeat(auto-fit, minmax(min(100%, 150px), 1fr)) }
/* the dashboard's attention tiles: wide enough for two words a line ("Cheques due / this week", not one word under the other) */
html.dt-ax:root .dat-row .dat{ flex-basis:min(64vw, 250px) }
/* the dashboard's lists: a property's name and a row's second line wrap, no dots; the Finance card's three figures stand one under the other,
   each label facing its whole amount ("Money in  333,350 EGP", never "333,3...") */
html.dt-ax:root .ditem .dt b, html.dt-ax:root .dprop .dp-t b, html.dt-ax:root .ditem .dt small, html.dt-ax:root .dprop .dp-t small{ white-space:normal; overflow:visible; overflow-wrap:anywhere }
/* a row with an amount and "Call" at its end (Overdue rent): the name keeps the first line and the amount faces its capsule on the line under it,
   no longer a name four lines tall in a third of the row */
html.dt-ax:root .ditem{ flex-wrap:wrap; row-gap:6px }
html.dt-ax:root .ditem .dt{ flex:1 1 0; min-width:60% }
html.dt-ax:root .ditem .damt{ flex:1 1 0; min-width:70%; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px }
html.dt-ax:root .cfrow{ flex-direction:column; gap:8px }
html.dt-ax:root .cfrow .cftile{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; column-gap:12px }
html.dt-ax:root .cftile b{ white-space:normal; overflow:visible }
/* Cashflow's three figures: one a line, so the third is not a narrow tile that cuts its amount */
html.dt-ax:root .cfcards .panel.cftile{ flex:1 1 100% }
/* Live chat's four choices: one a line, each reading whole ("All properties", not "All prope") */
html.dt-ax:root .msgselects{ grid-template-columns:repeat(auto-fit, minmax(min(100%, 260px), 1fr)) }
/* a long e-mail under a name (Team) breaks inside its card */
html.dt-ax:root .ent-meta{ overflow-wrap:anywhere }
/* the dashboard's money tiles: one a line on a phone, so "330,100" is not cut by a tile half the screen wide */
html.dt-ax:root .dcards{ grid-template-columns:repeat(auto-fit, minmax(min(100%, 260px), 1fr)) }
/* a settings row with a note at its end ("1 waiting"): the note goes under the row's words, which keep the whole line ("Money and currencies",
   not one word a line) */
html.dt-ax:root .hubrow{ flex-wrap:wrap; row-gap:4px }
html.dt-ax:root .hubrow .morerow-go{ order:2 }
html.dt-ax:root .hubrow .hubst{ order:3; flex:1 1 100%; max-width:none; text-align:start; padding-inline-start:58px }
/* a detail row (an expense's description, a unit's notes): a value too long to face its label goes under it and keeps the whole line,
   no longer one word a line beside it; a short one ("285 EGP") stays where it was */
html.dt-ax:root .setrow{ flex-wrap:wrap; row-gap:4px }
html.dt-ax:root .setrow > .k ~ *{ overflow-wrap:anywhere }
/* the line that says which countries and company the screen shows: whole on two lines, no dots */
html.dt-ax:root .fpill .ftxt{ white-space:normal; overflow:visible; text-align:start }
