/* Tenant portal additions on top of Portfolio's site.css (same tokens, same fonts) */
html { font-size: 14px; }
.mock-bar { background: var(--warning-bg); color: var(--warning-text); font-size: .8rem; padding: 4px 12px; text-align: center; }
.mock-bar button { font: inherit; border: 1px solid currentColor; background: none; color: inherit; border-radius: 999px; padding: 0 8px; margin: 0 2px; cursor: pointer; }
.mock-bar button.on { background: var(--warning-text); color: var(--warning-bg); }
.mock-bar a { color: inherit; }

.topbar .brand { width: auto; }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; font-size: .8rem; }

.wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero h1 { font-size: 1.5rem; }
.property-line { display: flex; gap: 10px; align-items: center; }
.property-line svg { width: 36px; height: 36px; flex: none; }

.req { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.req:last-child { border-bottom: 0; }
.req:hover { background: var(--surface-2); }
.req .ref { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; width: 60px; flex: none; }
.req .title { font-weight: 600; }
.req .meta { font-size: .85rem; color: var(--muted); }
.req .grow { flex: 1; min-width: 0; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.cat { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 8px; text-align: center; cursor: pointer; font: inherit; color: var(--text); }
.cat .ic { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.cat:hover { border-color: var(--accent); }
.cat.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.urg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 600px) { .urg { grid-template-columns: 1fr; } }
.urg label { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; cursor: pointer; display: block; }
.urg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.urg small { display: block; color: var(--muted); }
.callout { background: var(--danger-bg); color: var(--negative); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; font-weight: 550; }
.field input, .field select, .field textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.field textarea { min-height: 90px; resize: vertical; }
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb { width: 84px; height: 64px; border-radius: 8px; background: linear-gradient(135deg, var(--surface-2), var(--border)); display: grid; place-items: center; font-size: 1.5rem; }
.step-title { font-weight: 650; margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.step-title .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: .8rem; }

.stepper { display: flex; gap: 0; margin: 10px 0 4px; }
.stepper div { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); position: relative; padding-top: 22px; }
.stepper div::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--border); z-index: 1; }
.stepper div::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.stepper div:first-child::after { display: none; }
.stepper div.done { color: var(--text); }
.stepper div.done::before, .stepper div.done::after { background: var(--accent); }
.stepper div.now { color: var(--accent-strong); font-weight: 650; }
.stepper div.now::before { box-shadow: 0 0 0 4px var(--accent-soft); background: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .body { flex: 1; }
.timeline .when { font-size: .8rem; color: var(--muted); }
.timeline li.internal { background: var(--warning-bg); margin: 0 -12px; padding: 10px 12px; }
.timeline li.sys .body { color: var(--muted); font-size: .9rem; }

/* A request's thread by the workspace's conversation style (request.js; 700_conversation_style.sql).
   Email: one card per email - From, To, Date, Subject - newest first, the newest marked "Latest". */
.mail-subject { margin: -4px 0 4px; font-size: .9rem; }
#reply.reply-top { margin: 4px 0 14px !important; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.timeline.mail li.mail-card { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; background: var(--surface); }
.timeline.mail li.mail-card:last-child { border-bottom: 1px solid var(--border); }
.timeline.mail li.mail-card.latest { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.timeline.mail li.mail-card.internal { background: var(--warning-bg); margin: 0 0 10px; }
.timeline.mail li.sys { border: 0; padding: 2px 4px 10px; justify-content: center; text-align: center; }
.timeline.mail li.sys .body { flex: 0 1 auto; }
.mail-head { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 8px; font-size: .88rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mail-head dt { color: var(--muted); }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.timeline.mail .msg-text { white-space: pre-wrap; }
.mail-note { font-size: .85rem; margin-top: 6px; }

/* Text: phone-style bubbles on every screen size - mine on the right, theirs on the left, names and times small; the
   newest at the bottom, the list scrolling inside the card */
.timeline.chat { max-height: 65vh; overflow-y: auto; padding: 4px 2px; }
.timeline.chat li { border: 0; padding: 4px 0; display: flex; justify-content: flex-end; }
.timeline.chat li > .avatar { display: none; }
.timeline.chat li > .body { flex: 0 1 auto; max-width: min(85%, 560px); background: var(--accent-soft); color: var(--text); border-radius: 18px 18px 4px 18px; padding: 8px 14px; }
.timeline.chat li.theirs { justify-content: flex-start; }
.timeline.chat li.theirs > .body { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px 18px 18px 4px; }
.timeline.chat li.internal { background: none; margin: 0; padding: 4px 0; }
.timeline.chat li.internal > .body { background: var(--warning-bg); border: 1px dashed var(--border); }
.timeline.chat li .body > div:first-child { font-size: .78rem; color: var(--muted); }
.timeline.chat li .body > div:first-child b { font-weight: 600; }
.timeline.chat li .body .badge { font-size: .7rem; padding: 0 6px; }
.timeline.chat li .msg-text { white-space: pre-wrap; margin-top: 2px; }
.timeline.chat li .when { font-size: .72rem; margin-top: 3px; text-align: right; }
.timeline.chat li.theirs .when { text-align: left; }
.timeline.chat li.sys { justify-content: center; }
.timeline.chat li.sys > .body { background: none; border: 0; padding: 2px 8px; max-width: 90%; text-align: center; font-size: .82rem; color: var(--muted); }
.timeline.chat li.sys .when { text-align: center; font-size: .7rem; margin-top: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); font-size: .92rem; }
table.grid th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--surface-2); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters select, .filters input { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.sla-bad { color: var(--negative); font-weight: 600; }
.reply-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); }

/* ===== v2: address bar, tabs, admin, approvals */
.mock-bar .addr { font-family: ui-monospace, Consolas, monospace; background: rgba(0,0,0,.08); padding: 0 6px; border-radius: 4px; }
.mock-bar select { font: inherit; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; }
.layout2 { display: flex; min-height: calc(100vh - var(--topbar-h) - 24px); }
.side { width: 210px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 10px 6px; }
.side a { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.side a:hover { background: var(--surface-2); }
.side a.active { background: var(--accent-soft); color: var(--accent-strong); }
.side .section { margin: 14px 10px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side .count { margin-left: auto; background: var(--negative); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; }
.content { flex: 1; min-width: 0; padding: 18px 22px 40px; max-width: 1250px; }
@media (max-width: 800px) { .layout2 { flex-direction: column; } .side { width: auto; display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); } .side .section { display: none; } }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .form2 { grid-template-columns: 1fr; } }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.note { background: var(--accent-soft); color: var(--accent-strong); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; }
.warnbox { background: var(--warning-bg); color: var(--warning-text); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; letter-spacing: .12em; background: var(--surface-2); padding: 6px 12px; border-radius: 7px; display: inline-block; }
.diff del { color: var(--negative); } .diff ins { color: var(--positive); text-decoration: none; font-weight: 600; }
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree ul { list-style: none; padding-left: 20px; margin: 4px 0; border-left: 1px dashed var(--border); }
.tree li { padding: 3px 0; }
.synced { font-size: .75rem; color: var(--muted); }
.pf .topbar { border-top-color: #0f766e; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.big-icon { font-size: 2.5rem; text-align: center; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan-cards .card .price { font-size: 1.5rem; font-weight: 700; }
.money { font-variant-numeric: tabular-nums; text-align: right; }
table.grid td.money, table.grid th.money { text-align: right; }

/* ===== The real portal's additions to the mock-up's styles (phase 1) */
.brand img.ws-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 7px; flex: none; }
.signin-card .brand img.ws-logo { width: 34px; height: 34px; }
.topbar .who-link { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.topbar .who-link:hover { text-decoration: underline; }
.logo-preview { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.logo-preview svg { width: 48px; height: 48px; }
.logo-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.palette-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.empty { color: var(--muted); padding: 12px 4px; }
table.grid.plain tbody tr { cursor: default; }
table.grid.plain tbody tr:hover { background: none; }
.grid .row-actions { justify-content: flex-end; }
.mono { font-family: ui-monospace, Consolas, monospace; }
dialog textarea { width: 100%; min-height: 180px; font: inherit; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); box-sizing: border-box; }
dialog .field input, dialog .field select { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.placeholders code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; margin-right: 4px; font-size: .85rem; }

/* ===== Requests (phase 4) */
.thumb-img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; background: var(--surface-2); }
.file-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: .85rem; color: var(--text); text-decoration: none; background: var(--surface-2); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-box { width: 100%; min-height: 70px; font: inherit; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); box-sizing: border-box; }
.suspended-banner { margin: 0; border-radius: 0; text-align: center; }
a.row-link { color: inherit; text-decoration: none; }
a.row-link:hover { text-decoration: underline; }
table.grid tr[data-href] { cursor: pointer; }

/* ===== Layout fixes (browser review, Dec 2026) */
/* The line under a page's title sits right under it (a <p>'s own 1em margins left a big gap before the page) */
.page-head p, .content > h1 + p { margin: 2px 0 0; }
.content > h1 + p { margin-bottom: 12px; }
.page-head { align-items: flex-end; }   /* (buttons end level with the line under the title, so every page's table starts at the same height) */
.page-head .actions label { font-size: .8rem; line-height: 1.1; }
.page-head .actions .btn { white-space: nowrap; }
/* Buttons in a table row stay a real table cell: a flex cell didn't stretch to its row, so its line didn't meet the others */
table td.row-actions { display: table-cell; white-space: nowrap; text-align: right; vertical-align: middle; }
table td.row-actions > * { vertical-align: middle; }
table td.row-actions > * + * { margin-left: 6px; }
table.grid td { vertical-align: middle; }
/* Cards side by side start level (the "card after a card" gap is only for cards stacked down the page) */
.cols > .card + .card { margin-top: 0; }
/* A list's filters sit in one row, the search taking the spare room */
.filters { align-items: center; }
.filters select { width: auto; flex: 0 1 auto; max-width: 260px; }
.filters input { width: auto; flex: 1 1 240px; }
/* The audit log's date stays on one line */
body[data-page="admin-audit"] table td:first-child { white-space: nowrap; }
/* A button beside labelled inputs lines up with the inputs' bottom edge, not the labels' top */
.page-head .actions { align-items: flex-end; }
.page-head .actions .field, .page-head .actions label { margin-bottom: 0; }
[style*="align-items:end"] > .field, [style*="align-items: end"] > .field, [style*="align-items:flex-end"] > .field { margin-bottom: 0; }
/* Plans: every card the same size, filling the row so the last one ends level with "+ New plan"; buttons at the foot */
.plan-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: stretch; }
.plan-cards > .card { margin-top: 0; display: flex; flex-direction: column; }
.plan-cards > .card .row-actions { margin-top: auto !important; padding-top: 10px; }

/* Anything below the last card (a page's Save / Back to defaults buttons, a note) sits the same 16px below it as the
   next card would - the General page's empty error line pushed its Save down, Request fields' button touched its card */
#app main .form-error:empty, .content .form-error:empty { display: none; }
.card ~ .row-actions, .card ~ .note, .card ~ .form-error:not(:empty) { margin-top: 16px; }
.card ~ .form-error:not(:empty) + .row-actions { margin-top: 4px; }

/* Tabs on a settings page (Categories & statuses) */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 12px; }
.page-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.page-tabs button:hover { color: var(--text); }
.page-tabs button.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.page-tabs .count { font-weight: 500; font-size: .8rem; margin-left: 4px; color: var(--muted); }

/* The icon picker (category add / edit) */
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; max-height: 210px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.icon-pick button { font-size: 1.25rem; line-height: 1; height: 38px; border: 1px solid transparent; border-radius: 6px; background: var(--surface); cursor: pointer; padding: 0; }
.icon-pick button:hover { border-color: var(--border); }
.icon-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.icon-pick .group { grid-column: 1 / -1; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 2px 0; }
.icon-now { display: flex; align-items: center; gap: 8px; }
.icon-now .big { font-size: 1.6rem; width: 44px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.icon-now input { width: 90px; }
.cat-icon { width: 26px; text-align: center; font-size: 1.1rem; flex: none; }

/* General & address: linked to RITS Portfolio, or separate */
.mode-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.mode-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.mode-opt:has(input:disabled) { opacity: .6; cursor: default; }
.mode-opt input { margin-top: 3px; flex: none; width: auto; }
.mode-opt span { display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 760px) { .mode-choice { grid-template-columns: 1fr; } }

/* Workspace Billing: Your plan - the plan on the left, who invoices go to on the right */
.bill-plan { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.bill-plan > form { border-left: 1px solid var(--border); padding-left: 24px; }
.bill-plan-name { font-size: 1.05rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bill-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bill-tiles > div { background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.bill-tiles span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bill-tiles b { font-weight: 600; }
@media (max-width: 900px) { .bill-plan { grid-template-columns: 1fr; } .bill-plan > form { border-left: 0; padding-left: 0; } }

/* Properties & tenants by hand (a workspace kept separate from RITS Portfolio): small Edit / Archive buttons beside each
   building, space, lease and contact; each tenant a block with its leases and contacts side by side; the lease dialog's
   spaces as a scrolling list of ticks, grouped by property */
.tree-actions { margin-left: 8px; white-space: nowrap; }
.tree-actions .btn + .btn { margin-left: 4px; }
.tree li > .tree-actions, .plain-list .tree-actions { opacity: .55; transition: opacity .15s; }
.tree li:hover > .tree-actions, .plain-list li:hover .tree-actions, .tree-actions:focus-within { opacity: 1; }
.manual-tenant { padding: 12px 0; border-top: 1px solid var(--border); }
.manual-tenant:first-of-type { border-top: 0; padding-top: 0; }
.manual-tenant h3 { margin: 0 0 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.manual-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.manual-cols h4 { margin: 0 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.lease-spaces { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.lease-spaces .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 0; }
.lease-spaces .group:first-child { margin-top: 0; }
@media (max-width: 760px) { .manual-cols { grid-template-columns: 1fr; } }

/* NZ Post address lookup (site.js PropSD.addressLookup): the suggestions under an address box */
.addr-host { position: relative; }
.addr-list { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; padding: 4px; }
.addr-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: 6px; font: inherit; font-size: .92rem; color: var(--text); cursor: pointer; }
.addr-list button:hover, .addr-list button.on { background: var(--accent-soft); }
.addr-list .addr-by { font-size: .72rem; color: var(--muted); padding: 4px 9px 2px; text-align: right; }

/* The request page: Owners' small "Delete request" button, tucked under the right-hand column */
.request-delete { text-align: right; margin: 12px 0 0; }

/* Properties & tenants -> Archived: what's in the way of restoring a row (its property, building or tenant archived) */
.archived-list .archived-blocked { color: var(--negative); }

/* The picture across the top of the sign-in (and register, forgot...) box: the workspace's own, or signin-default.jpg */
.signin-card { overflow: hidden; }
.signin-hero { margin: -12px -12px 16px; height: 150px; background: var(--surface-2); }
.signin-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
:root[data-density="compact"] .signin-hero { margin: -8px -8px 12px; }
.signin-preview { width: 320px; max-width: 100%; height: 120px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.signin-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* (the built-in photo - Pexels, free licence: a building's top floors against blue sky - is cropped to its building) */
.signin-hero img[src$="signin-default.jpg"], .signin-preview img[src$="signin-default.jpg"] { object-position: center 72%; }

/* Staff request -> Manage: the status as a row of buttons (radios) instead of a drop-down; the chosen one in the
   status's colour (as PropSD.statusBadge: new red, waiting amber, resolved/closed green, others the accent) */
.status-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.status-pick label { position: relative; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; user-select: none; }
.status-pick input { position: absolute; opacity: 0; pointer-events: none; }
.status-pick label:hover { border-color: var(--accent); }
.status-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-pick label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.status-pick label.st-new:has(input:checked) { background: var(--negative); border-color: var(--negative); color: #fff; }
.status-pick label.st-waiting:has(input:checked) { background: var(--warning, #b7791f); border-color: var(--warning, #b7791f); color: #fff; }
.status-pick label.st-resolved:has(input:checked), .status-pick label.st-closed:has(input:checked) { background: var(--positive, #2f855a); border-color: var(--positive, #2f855a); color: #fff; }

/* On a computer the left menu stays put while the page scrolls (under the sticky top bar); a long menu scrolls on its own */
@media (min-width: 801px) {
  .layout2 > .side { position: sticky; top: var(--topbar-h); align-self: flex-start; height: calc(100vh - var(--topbar-h)); box-sizing: border-box; overflow-y: auto; }
}

/* Your account -> Notifications (notifications.js) */
#notifyCard h3 { font-size: 1rem; margin: 18px 0 6px; }
#notifyCard .notify-browser p { margin: 0 0 10px; }
#notifyCard .notify-kinds { width: 100%; }
#notifyCard .notify-kinds th:not(:first-child), #notifyCard .notify-kinds td:not(:first-child) { text-align: center; width: 1%; white-space: nowrap; padding-left: 12px; }
#notifyCard .notify-tick { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; cursor: pointer; }
#notifyCard .notify-tick input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
#notifyCard .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Settings -> Emails -> Mailbox: the address and "Get the approval link" sit on one line, the button level with the box */
#mbxForm .field { margin-bottom: 0; }
#mbxForm .field input { min-width: min(300px, 100%); }
@media (max-width: 560px) { #mbxForm { flex-direction: column; align-items: stretch !important; } }

/* Settings -> Emails -> Mailbox: space between its three cards (the middle one sits in a wrapper, so .card + .card misses
   it), the address and its button on one line, the emailed-request defaults two to a row with room to breathe */
#mbxBox > * + .card { margin-top: 16px; }
#mbxForm .field { flex: 1 1 320px; }
#erForm h3 { margin: 20px 0 10px; }
#erForm .row > .field { flex: 1 1 280px; margin-bottom: 6px; }
#erForm .field > span { margin-bottom: 2px; }
#erForm .check { margin-top: 6px; }
#erForm > .row:last-child { margin-top: 20px !important; }
/* Buttons side by side in a table row (Edit wording / Send test, and the like): a clear gap between them */
table td.row-actions > .btn + .btn, table td.row-actions > a.btn + .btn, table td.row-actions > .btn + a.btn { margin-left: 8px; }
/* .row: things side by side, wrapping on narrow screens (the mailbox pages use it; their own gap/alignment win) */
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Properties & tenants -> Tenant Portal Access (staff.js; both kinds of the page). The per-tenant button is a pill with a
   coloured dot - none / some / all of its contacts can use the portal - and the popups list each contact as a card row
   (like .mode-opt) with its access and actions, with room between everything. */
.access-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px !important; font-weight: 600; white-space: nowrap; }
.access-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.access-btn.lvl-some { border-color: var(--warning-text, #b7791f); }
.access-btn.lvl-some .dot { background: var(--warning-text, #b7791f); }
.access-btn.lvl-all { border-color: var(--positive); }
.access-btn.lvl-all .dot { background: var(--positive); }
.access-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.page-head .actions.access-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.access-pop { display: flex; flex-direction: column; gap: 14px; }
.access-pop .access-note { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: .9rem; }
.access-pop .access-note.warn { background: var(--warning-bg); color: var(--warning-text); }
.access-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.access-tools input[type=search] { flex: 1 1 260px; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.access-tools .status-pick { margin-top: 0; }
.access-list { display: flex; flex-direction: column; gap: 18px; }
.access-tenant { display: flex; flex-direction: column; gap: 10px; }
.access-tenant > header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.access-tenant > header h3 { margin: 0; font-size: 1rem; }
.access-rows { display: flex; flex-direction: column; gap: 10px; }
.access-row { display: grid; grid-template-columns: auto minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.access-row.no-pick { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
.access-row.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.access-row > input[type=checkbox] { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.access-row .pick-gap { width: 18px; }
.access-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.access-who small { overflow-wrap: anywhere; }
.access-state { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.access-state small { color: var(--muted); }
.access-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.access-bulk { position: sticky; bottom: -14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); box-shadow: 0 -4px 14px rgba(10, 15, 20, .08); }
.access-bulk .grow { flex: 1; }
.access-empty { padding: 16px; text-align: center; color: var(--muted); }
/* + Add person (staff.js addPerson): the button at the end of the popup's tools, and its form - roomy */
.access-tools .access-add { margin-left: auto; padding: 9px 18px; white-space: nowrap; }
.access-tools.access-tools-one { justify-content: flex-end; }
.add-person { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 6px; }
.add-person .field { margin-bottom: 0; gap: 5px; }
.add-person .field input, .add-person .field select { padding: 9px 11px; }
.add-person .form2 { gap: 12px 18px; }
.add-person .add-person-for { margin: 0; font-size: 1rem; }
.add-person .add-person-invite { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.add-person .add-person-invite .switch { font-weight: 600; }
.add-person .access-note { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) {
  .access-row, .access-row.no-pick { grid-template-columns: auto minmax(0, 1fr); }
  .access-row.no-pick > * { grid-column: 1 / -1; }
  .access-row .access-state, .access-row .access-acts { grid-column: 2; justify-content: flex-start; }
}
