/* QCG resident portal. Same tokens, type and tone as quinncapitalgrp.com. */
[hidden] { display: none !important; }

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/instrument-sans-400-700-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-mono-500-latin.woff2) format("woff2"); }

:root {
  --ink: #0E1311; --ink-2: #161D1A; --ink-3: #222A26;
  --paper: #F3F1EA; --paper-2: #E9E6DC; --paper-3: #DEDACD;
  --forest: #1E3A30; --forest-deep: #132820;
  --clay: #B4552B; --clay-text: #96411D;
  --stone: #5F6661; --stone-light: #9AA19B;
  --line: rgba(14, 19, 17, 0.12); --line-strong: rgba(14, 19, 17, 0.26);
  --ok: #1E5A3C; --ok-bg: #E2EDE5; --warn: #8A5A12; --warn-bg: #F4E9D3; --bad: #96411D; --bad-bg: #F5E3DA; --info-bg: #E6E9EC;
  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(18px, 3.4vw, 40px);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
::selection { background: var(--forest); color: var(--paper); }
.skip { position: absolute; left: 12px; top: 12px; padding: 10px 14px; background: var(--ink); color: var(--paper); z-index: 50; }
.skip:not(:focus-visible) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--pad); }
.wrap.wide { max-width: 1320px; }

.envbar { padding: 7px var(--pad); background: var(--clay); color: #fff; font: 500 11.5px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; text-align: center; }
.envbar strong { font-weight: 500; padding: 1px 6px; margin-right: 6px; border: 1px solid rgba(255,255,255,.7); }
/* Staging stripes so it can never be mistaken for development or the live portal. */
.envbar-staging { background: repeating-linear-gradient(135deg, #7A4F0F 0 14px, #8A5A12 14px 28px); }

/* ---------- header ---------- */
.top { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo svg { height: 21px; width: auto; fill: currentColor; overflow: visible; }
.logo .lg-block { transition: transform .6s var(--ease); }
.logo:hover .lg-block, .logo:focus-visible .lg-block { transform: translate(60px, 60px); }
.area-tag { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--paper); background: var(--forest); padding: 4px 8px; }
.topnav { margin-left: auto; }
.topnav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.topnav a { position: relative; display: block; white-space: nowrap; padding: 8px 12px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--stone); transition: color .2s; }
.topnav a:hover, .topnav a:focus-visible, .topnav a[aria-current="page"] { color: var(--ink); }
.topnav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.topnav a:hover::after, .topnav a:focus-visible::after, .topnav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.signout { display: flex; align-items: center; gap: 16px; margin-left: 8px; white-space: nowrap; }
.signout a[aria-current="page"] { color: var(--ink); background-size: 100% 1px; }
.area-public .signout, .area-applicant .signout { margin-left: auto; }

/* ---------- type ---------- */
/* main also has .wrap (horizontal padding only), so this needs the extra specificity to keep its top space. */
main.wrap { padding-top: clamp(36px, 5vw, 64px); padding-bottom: 120px; min-height: 70vh; }
main:focus { outline: none; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 2.4vw, 28px); }
h3 { font-size: 18px; letter-spacing: -0.01em; }
p { margin: 0; }
.label { font: 500 11.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
.muted { color: var(--stone); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: clamp(24px, 3vw, 36px); }
.page-head .label { display: block; margin-bottom: 14px; }
.page-head p { margin-top: 14px; color: var(--stone); max-width: 60ch; }
.page-head p .badge { vertical-align: 1px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.section { margin-top: clamp(32px, 4vw, 48px); }
.section-sm { margin-top: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ---------- buttons and links ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 15px var(--sans); text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate; transition: color .4s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--forest); transform: translateY(101%); transition: transform .5s var(--ease); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn .arr { transition: transform .5s var(--ease); }
.btn:hover .arr, .btn:focus-visible .arr { transform: translateX(4px); }
.btn { transition: color .4s var(--ease), transform .15s var(--ease), opacity .2s; }
.btn:active:not([disabled]) { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.is-busy { opacity: .8; cursor: progress; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[disabled]::before { display: none; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-line::before { background: var(--ink); }
.btn-line:hover, .btn-line:focus-visible { color: var(--paper); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-xs { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: var(--bad); }
.btn-block { width: 100%; }
.linkish { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--stone); cursor: pointer; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: color .2s, background-size .45s var(--ease); }
.linkish:hover, .linkish:focus-visible { color: var(--ink); background-size: 100% 1px; }
.link { font-weight: 500; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
.link:hover { background-size: 0 1px; background-position: 100% 100%; transition: background-size .45s var(--ease); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- cards and stats ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px); }
.card-ink { background: var(--forest-deep); color: var(--paper); border-color: transparent; }
.card-ink .label, .card-ink .muted { color: var(--stone-light); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.balance { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.balance-amount { margin: 14px 0 6px; font-size: clamp(44px, 7vw, 64px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.balance .btn { margin-top: 22px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { display: block; margin-top: 8px; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.stat .num-pos { color: var(--ok); }
.stat .num-neg { color: var(--bad); }
.stat-link { text-decoration: none; transition: border-color .2s, transform .3s var(--ease), box-shadow .3s var(--ease); }
.stat-link:hover, .stat-link:focus-visible { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(14,19,17,.06); }
.stat-alert { border-color: rgba(150,65,29,.45); }
.stat-alert .num { color: var(--bad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--stone); }
.kv dd { margin: 0; }

/* ---------- tables and lists ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stone); background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--paper); }
.list { margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.item { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; }
.list > li:has(a.item) { padding: 0; }
.list > li > a.item { padding: 16px 18px; transition: background-color .2s; }
.list > li > a.item:hover, .list > li > a.item:focus-visible { background: #FAF9F5; }
.list > li:first-child > a.item { border-radius: var(--radius) var(--radius) 0 0; }
.list > li:last-child > a.item { border-radius: 0 0 var(--radius) var(--radius); }
tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.empty { padding: 28px; text-align: center; color: var(--stone); background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.total-row td { font-weight: 600; border-top: 1px solid var(--line-strong); }

/* ---------- status badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 500 11px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; background: var(--info-bg); color: var(--ink-3); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-succeeded, .badge-paid, .badge-completed, .badge-active, .badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-processing, .badge-requires_action, .badge-partial, .badge-due, .badge-scheduled, .badge-in_progress, .badge-invited, .badge-pending, .badge-sent, .badge-conditional, .badge-partially_refunded, .badge-consented, .badge-report_ready { background: var(--warn-bg); color: var(--warn); }
.badge-failed, .badge-returned, .badge-disputed, .badge-overdue, .badge-urgent, .badge-declined, .badge-disabled { background: var(--bad-bg); color: var(--bad); }
.badge-refunded, .badge-void, .badge-canceled, .badge-removed, .badge-withdrawn, .badge-internal, .badge-vacant, .badge-offline { background: var(--paper-2); color: var(--stone); }
.badge-submitted, .badge-high { background: var(--warn-bg); color: var(--warn); }
.badge-occupied, .badge-low, .badge-medium { background: var(--info-bg); color: var(--ink-3); }
/* Work in motion breathes slowly, so a processing payment reads as alive, not stuck. */
.badge-processing::before, .badge-in_progress::before, .badge-scheduled::before { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }

/* ---------- forms ---------- */
form .field + .field, .field + .field { margin-top: 18px; }
/* Consistent space between form blocks, so a button never touches the field above it. */
:not(.stack-lg, .form-grid, .form-grid-4, .check-grid, .choices, .grid-2, .grid-3, .grid-4, .side-grid, .actions) > :is(.field, .form-grid, fieldset, label.check, .choices, .notice, .check-grid) + :is(.field, .form-grid, fieldset, label.check, .actions, .check-grid, .notice) { margin-top: 18px; }
:not(.stack-lg) > :is(.form-grid, fieldset, .field, label.check) + .actions { margin-top: 22px; }
.field label, .field .flabel { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 500; }
.field .hint { display: block; margin-top: 6px; font-size: 13px; color: var(--stone); }
input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink); font: 16px var(--sans);
  transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(30, 58, 48, 0.14); }
input[type="file"] { font: 14px var(--sans); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; display: block; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .2s, box-shadow .2s, background-color .2s, transform .15s var(--ease); }
.choice:hover { border-color: var(--forest); }
.choice:active { transform: scale(.99); }
.choices-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice-urgent:has(input:checked) { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); background: #FCF6F2; }
.choice input { position: absolute; opacity: 0; }
.choice strong { display: block; font-weight: 500; }
.choice span { display: block; margin-top: 3px; font-size: 13px; color: var(--stone); }
.choice:has(input:checked) { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); background: #F7FAF8; }
.choice:has(input:focus-visible) { outline: 2px solid var(--clay); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2, .form-grid .span-all { grid-column: 1 / -1; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
legend .muted, label .muted { font-weight: 400; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; background: var(--forest); color: var(--paper); font: 500 12px var(--mono); vertical-align: 1px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { width: auto; max-width: 150px; min-height: 34px; padding: 6px 10px; font-size: 14px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 500; }

/* ---------- notices ---------- */
.flash { margin-bottom: 24px; padding: 14px 18px; border-radius: var(--radius); font-size: 15px; animation: drop .5s var(--ease) both; }
.flash:focus { outline: none; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.emergency { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 24px; padding: 16px 18px; border: 1px solid rgba(150,65,29,.35); border-left: 4px solid var(--clay); border-radius: var(--radius); background: #FCF6F2; font-size: 15px; }
.emergency strong { color: var(--clay-text); }
.emergency a { font-weight: 600; color: var(--clay-text); }
.emergency-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--clay); color: #fff; font: 600 15px var(--sans); }
.notice { padding: 16px 18px; border-radius: var(--radius); background: var(--paper-2); font-size: 15px; }
.notice-warn { background: var(--warn-bg); color: #5C3C0B; }
.notice.is-urgent { background: var(--bad-bg); color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.provider-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--stone); }
.provider-note::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: 7px; background: var(--clay); }
.provider-note + .field, .provider-note + .actions { margin-top: 20px; }

/* ---------- payment page ---------- */
.pay-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.summary-lines { margin: 0; padding: 0; list-style: none; }
.summary-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.summary-lines li.total { border-bottom: 0; font-size: 19px; font-weight: 600; }
#payment-element { min-height: 120px; }
.review[hidden], .step[hidden] { display: none; }
.timeline { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line-strong); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
.timeline li.done::before { background: var(--forest); box-shadow: none; }
.timeline .when { display: block; font: 12px var(--mono); color: var(--stone); }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photos a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- auth pages ---------- */
.auth { max-width: 460px; margin: clamp(20px, 6vh, 80px) auto 0; }
.auth h1 { font-size: clamp(32px, 5vw, 44px); margin: 14px 0 12px; }
.auth .card { margin-top: 28px; }

/* ---------- footer and mobile tab bar ---------- */
.foot { border-top: 1px solid var(--line); padding: 26px 0 30px; font-size: 13px; color: var(--stone); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.foot .mark svg { width: 18px; height: 18px; fill: var(--ink); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.tabbar { display: none; }

@media (max-width: 860px) {
  .topnav { display: none; }
  .balance, .pay-grid, .grid-2, .grid-3, .form-grid, .side-grid, .glance-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-4, .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: auto; }
  .area-resident main, .area-lender main { padding-bottom: 130px; }
  .area-resident .foot, .area-lender .foot { padding-bottom: 110px; }
  .tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(243, 241, 234, 0.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; text-decoration: none; font-size: 11px; font-weight: 500; color: var(--stone); }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] .ic { stroke: var(--forest); }
  th, td { padding: 11px 12px; }
  .hide-sm { display: none; }
}
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 520px) {
  .form-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { gap: 10px; }
  .stat { padding: 16px; }
  .stat .num { font-size: 22px; overflow-wrap: anywhere; }
}

/* ---------- motion ---------- */
/* Pages rise in quickly; navigation cross fades where the browser supports it. Header stays put. */
main.wrap > * { animation: rise .55s var(--ease) both; }
main.wrap > :nth-child(2) { animation-delay: 40ms; }
main.wrap > :nth-child(3) { animation-delay: 80ms; }
main.wrap > :nth-child(4) { animation-delay: 120ms; }
main.wrap > :nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
.envbar { view-transition-name: envbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  @view-transition { navigation: none; }
}
@media print {
  .top, .foot, .tabbar, .envbar, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
}

/* ---------- lease documents and signing ---------- */
@font-face { font-family: "QCG Signature"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/dancing-script-500.ttf) format("truetype"); }
.lease-doc { font-size: 15.5px; line-height: 1.65; max-width: 70ch; }
.lease-doc h1 { font-size: 30px; margin: 0 0 18px; }
.lease-doc h2 { font-size: 19px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.lease-doc h3 { font-size: 16px; margin: 18px 0 6px; }
.lease-doc p { margin: 0 0 12px; }
.lease-doc ul { margin: 0 0 12px; padding-left: 20px; }
.lease-doc li { margin: 4px 0; }
.sig-placeholder { margin-top: 22px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--stone); font-size: 14px; }
.sign-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.doc-card { max-height: 78vh; overflow-y: auto; }
.sign-panel { position: sticky; top: 90px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); }
.seg label { position: relative; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { background: #fff; box-shadow: 0 1px 3px rgba(14,19,17,.12); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--clay); outline-offset: 2px; }
.sig-preview { margin-top: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--ink); font: 500 36px/1.2 "QCG Signature", cursive; min-height: 64px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sig-pad { display: block; width: 100%; height: 170px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
@media (max-width: 860px) {
  .sign-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-card { max-height: none; }
  .sign-panel { position: static; }
}
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.tpl-body { min-height: 60vh; font: 14px/1.6 var(--mono); }
.field-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.chip { padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font: 12px var(--mono); cursor: pointer; }
.chip:hover, .chip:focus-visible { border-color: var(--forest); color: var(--forest); }
@media (max-width: 860px) { .tpl-grid { grid-template-columns: minmax(0, 1fr); } }
fieldset.person { padding: 16px 0 0; border-top: 1px solid var(--line); }
fieldset.person:first-of-type { border-top: 0; padding-top: 0; }
.sign-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; border-left: 3px solid var(--clay); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { max-width: 240px; min-height: 40px; padding: 8px 12px; }

/* ---------- layout helpers ---------- */
.side-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.side-note { position: sticky; top: 96px; }
fieldset { min-width: 0; }
@media (max-width: 860px) { .side-grid { grid-template-columns: minmax(0, 1fr); } .side-note { position: static; } }
.steps-list { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps-list li { position: relative; padding: 0 0 16px 34px; counter-increment: s; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font: 500 12px var(--mono); color: var(--stone); }
.steps-list strong { display: block; font-weight: 500; }
.steps-list span { display: block; font-size: 14px; color: var(--stone); margin-top: 2px; }
.center { text-align: center; }
th.center { text-align: center; }
.alert-grid td.center input { width: 20px; height: 20px; accent-color: var(--forest); }

/* ---------- tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { position: relative; padding: 10px 14px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--stone); transition: color .2s; }
.tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--forest); transform: scaleX(0); transition: transform .35s var(--ease); }
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- progress tracker ---------- */
.tracker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.tracker li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-top: 26px; font-size: 14px; }
.tracker li::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: var(--paper-3); }
.tracker li.done::before, .tracker li.current::before { background: var(--forest); transform-origin: left; animation: grow .7s var(--ease) both; }
.tracker li.current::before { background: linear-gradient(90deg, var(--forest) 0 50%, var(--paper-3) 50%); }
.tracker .dot { position: absolute; top: 2px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--paper-3); }
.tracker li.done .dot { background: var(--forest); box-shadow: none; }
.tracker li.current .dot { background: #fff; box-shadow: inset 0 0 0 4px var(--forest); }
.tracker li.current .dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--forest); animation: ping 2.4s var(--ease) infinite; }
.tracker strong { font-weight: 500; }
.tracker li:not(.done):not(.current) strong { color: var(--stone); }
.tracker .when { font: 12px var(--mono); color: var(--stone); }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes ping { 0% { opacity: .7; transform: scale(.8); } 70%, 100% { opacity: 0; transform: scale(1.5); } }
@media (max-width: 520px) { .tracker { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; } }

/* ---------- photo picker ---------- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #FAF9F5; text-align: center; cursor: pointer; transition: border-color .2s, background-color .2s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--forest); background: #F4F7F5; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-title { font-weight: 500; }
.dz-hint { font-size: 13px; color: var(--stone); }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.photo-previews:empty { display: none; }
.photo-previews li { display: flex; flex-direction: column; gap: 6px; animation: rise .4s var(--ease) both; }
.photo-previews img, .photo-previews .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); display: grid; place-items: center; font-size: 12px; color: var(--stone); }
.photo-previews .cap { font-size: 12px; color: var(--stone); overflow-wrap: anywhere; }
.photo-previews li.is-error img, .photo-previews li.is-error .ph { outline: 2px solid var(--bad); outline-offset: -2px; }
#photos-status { margin-top: 8px; }
#photos-status.is-error, .photo-previews li.is-error .cap { color: var(--bad); }

/* ---------- resident home ---------- */
.next-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; border-left: 4px solid var(--forest); }
.next-step.tone-urgent { border-left-color: var(--bad); background: #FCF6F2; }
.next-step.tone-action { border-left-color: var(--clay); }
.next-step h2 { margin-top: 8px; }
.next-step p { margin-top: 6px; color: var(--stone); max-width: 62ch; }
.glance { margin: 12px 0 0; padding: 0; list-style: none; }
.glance li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.glance li:last-child { border-bottom: 0; padding-bottom: 0; }
.glance .k { color: var(--stone); flex: none; }
.glance .v { text-align: right; }
.balance-status { margin-top: 4px; }
.balance-status.is-late { color: #F0B79B; }
.what-next { margin: 12px 0 0; padding: 0; list-style: none; }
.what-next li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.what-next li:last-child { border-bottom: 0; }
.what-next .when { font: 12px/1.6 var(--mono); color: var(--stone); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- charts ---------- */
.chart { margin: 8px 0 0; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .tick { font: 11px var(--mono); fill: var(--stone); }
.chart .end-label { font: 600 13px var(--sans); fill: var(--ink); }
.chart .pt { cursor: default; outline: none; }
.chart .pt.is-on path, .chart .pt.is-on circle + circle { filter: brightness(1.12); }
.chart .pt:focus-visible rect:first-child, .chart .pt:focus-visible circle:first-child { stroke: var(--clay); stroke-width: 2; }
.chart-tip { position: fixed; left: 0; top: 0; z-index: 60; display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px 12px; border-radius: var(--radius); background: var(--ink); color: var(--paper); font-size: 13px; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.chart-tip-title { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--stone-light); }
.chart-tip-value strong { font-size: 17px; font-weight: 600; margin-right: 6px; }
.chart-tip-row { color: var(--stone-light); }
.chart-tip-row strong { color: var(--paper); font-weight: 500; margin-right: 6px; }
.chart-tip-value span, .chart-tip-row span { font-size: 12px; }
.table-view { margin-top: 12px; }
.table-view summary { display: inline; cursor: pointer; }
.sms-card { border-left: 3px solid var(--forest); }
.list-flat { border: 0; background: transparent; }
.list-flat > li > a.item { padding: 12px 4px; border-radius: 0; }
.attention { border-left: 4px solid var(--clay); }

/* ---------- lender portal ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.figure { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.figure-num { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
@media (max-width: 860px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .figures { grid-template-columns: minmax(0, 1fr); } }
.badge-sec-secured { background: var(--ok-bg); color: var(--ok); }
.badge-sec-pending { background: var(--warn-bg); color: var(--warn); }
.badge-sec-unsecured { background: var(--paper-2); color: var(--ink-3); }
.badge-test { background: #2A2E2C; color: #F3F1EA; }
.badge-info { background: var(--info-bg); color: var(--ink-3); }
.basis summary { cursor: pointer; list-style: none; }
.basis summary::-webkit-details-marker { display: none; }
.basis summary .label::after { content: " +"; }
.basis[open] summary .label::after { content: " \2212"; }
.payment-row { align-items: flex-start !important; }
.payment-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.line-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; white-space: nowrap; }
.line-principal { border-color: rgba(30,58,48,.4); }
.line-interest { border-color: rgba(14,19,17,.3); }
.line-profit { border-style: dashed; }
.messages { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.messages li { max-width: 72ch; padding: 12px 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); animation: rise .4s var(--ease) both; }
.messages li.mine { margin-left: auto; background: #F4F7F5; border-color: rgba(30,58,48,.25); }
.messages .when { display: block; margin-bottom: 4px; font: 12px var(--mono); color: var(--stone); }
.checklist { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist .tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; color: #fff; transition: background-color .3s, border-color .3s; }
.checklist li.ok .tick { background: var(--forest); border-color: var(--forest); }
.collateral { padding: 14px 0; border-bottom: 1px solid var(--line); }
.collateral:last-of-type { border-bottom: 0; }
table.schedule td { vertical-align: middle; }
.area-tag-quiet { background: transparent; color: var(--stone); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- guided setup, messages, automation ---------- */
.setup { margin-bottom: 20px; border-left: 4px solid var(--clay); animation: rise .45s var(--ease) both; }
.setup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.setup-head h2 { margin-top: 8px; }
.setup-bar { height: 6px; margin: 18px 0 4px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--forest); border-radius: inherit; transform-origin: left; animation: grow .9s var(--ease) both; }
.checklist li.now strong { color: var(--clay-text); }
.checklist li.now .tick { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(180, 85, 43, .15); }
.chat { max-height: 62vh; overflow-y: auto; padding: 4px 2px 8px; scroll-behavior: smooth; }
.chat-compose { margin-top: 20px; }
.chat-compose textarea { min-height: 96px; }
.inbox li.unread strong { font-weight: 600; }
.inbox li.unread { box-shadow: inset 3px 0 0 var(--clay); }
.badge-action { background: var(--warn-bg); color: var(--warn); }
.badge-applied { background: var(--ok-bg); color: var(--ok); }
.badge-pending_signature { background: var(--warn-bg); color: var(--warn); }
.badge-expired { background: var(--paper-2); color: var(--stone); }
.badge-draft { background: var(--paper-2); color: var(--stone); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 500 11.5px/1.6 var(--mono); white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-todo { background: var(--warn-bg); color: var(--warn); }
.field-inline { display: grid; grid-template-columns: 1fr 90px; align-items: center; column-gap: 12px; }
.field-inline .hint { grid-column: 1 / -1; }
.section-tight { margin-bottom: 16px; }
@media (max-width: 760px) { .chat { max-height: none; } }
@media (prefers-reduced-motion: reduce) { .setup, .setup-bar span { animation: none; } .chat { scroll-behavior: auto; } }


/* ---------- header: account menu, and the management menu on its own row when space is short ---------- */
.top-inner { flex-wrap: wrap; row-gap: 0; }
.logo { flex: none; }
.acct { position: relative; margin-left: auto; flex: none; }
.topnav + .acct { margin-left: 8px; }
.acct summary { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 999px; cursor: pointer; list-style: none; color: var(--ink); font-size: 14.5px; font-weight: 500; transition: background-color .2s; }
.acct summary::-webkit-details-marker { display: none; }
.acct summary:hover, .acct[open] summary { background: var(--paper-2); }
.acct summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.acct-badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--forest); color: var(--paper); font: 500 12px var(--mono); letter-spacing: .02em; }
.acct-caret { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .2s; }
.acct[open] .acct-caret { transform: rotate(180deg); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 40px -18px rgba(14, 19, 17, .35); animation: acct-in .18s var(--ease); }
@keyframes acct-in { from { opacity: 0; transform: translateY(-4px); } }
.acct-who { display: grid; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.acct-who strong { font-weight: 500; }
.acct-who span { font-size: 13px; color: var(--stone); overflow-wrap: anywhere; }
.acct-menu a, .acct-menu button { display: block; width: 100%; padding: 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a:focus-visible, .acct-menu button:focus-visible { background: var(--paper); outline: none; }
.acct-menu a[aria-current="page"] { font-weight: 500; }
.acct-menu form { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.acct-menu button { color: var(--bad); }

/* Management: one row on wide screens; on laptops the sections move to a scrollable second row. */
@media (max-width: 1500px) {
  .area-manage .topnav { order: 3; flex-basis: 100%; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
  .area-manage .topnav::-webkit-scrollbar { display: none; }
  .area-manage .topnav ul { padding: 4px 0; }
  .area-manage .topnav a { padding: 10px 12px; font-size: 14.5px; }
  .area-manage .acct { margin-left: auto; }
}

@media (max-width: 860px) {
  .top-inner { gap: 14px; min-height: 60px; }
  .area-manage .topnav { display: block; }
  .acct-name { display: none; }
  .acct summary { padding: 4px; }
  .area-tag { font-size: 10px; padding: 3px 6px; }
  .acct-menu { min-width: 0; width: min(300px, calc(100vw - 24px)); }
  .acct, .topnav + .acct { margin-left: auto; }
  .area-manage .topnav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .area-manage .topnav.at-end { -webkit-mask-image: none; mask-image: none; }
}

/* Phones: tables become one card per row, each value labeled with its column (labels added by app.js). */
@media (max-width: 600px) {
  .table-wrap:has(table.stack) { overflow: visible; }
  table.stack thead { display: none; }
  table.stack { display: grid; }
  table.stack tbody, table.stack tr { display: block; width: 100%; }
  table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: block; padding: 4px 0; border: 0; text-align: right; white-space: normal; }
  table.stack td::after { content: ""; display: table; clear: both; }
  table.stack td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: 16px; padding-top: 2px; text-align: left; font: 500 10.5px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
  table.stack td:first-child { display: block; padding: 0 0 6px; text-align: left; font-weight: 500; }
  table.stack td:first-child::before { content: none; }
  table.stack td:empty { display: none; }
  table.stack td:not([data-label])::before, table.stack td[data-label=""]::before { content: none; }
  table.stack tr.row-urgent { box-shadow: inset 3px 0 0 var(--bad); }
  table.stack tr.row-urgent td:first-child { box-shadow: none; }
  table.stack .total-row td { border-top: 0; }
  table.stack tr.total-row { border-top: 1px solid var(--line-strong); }
}

/* ---------- home screen app ---------- */
body { touch-action: manipulation; }
@media (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea, p, td, dd, pre, .chat { -webkit-user-select: text; user-select: text; } }
.install-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; margin-bottom: 20px; border-left: 4px solid var(--forest); }
.install-card img { flex: none; border-radius: 10px; }
.install-card > div:nth-child(2) { flex: 1 1 180px; display: grid; gap: 2px; }
.install-card strong { font-weight: 500; }
.install-card span { font-size: 14px; color: var(--stone); }
.install-card-actions { display: flex; align-items: center; gap: 14px; }
.install { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.install[hidden] { display: none; }
.install-backdrop { position: absolute; inset: 0; background: rgba(14, 19, 17, .45); animation: fade .2s ease both; }
.install-panel { position: relative; width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 24px var(--pad) calc(24px + env(safe-area-inset-bottom)); background: var(--paper); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 50px -20px rgba(14, 19, 17, .4); animation: sheet-up .35s var(--ease) both; outline: none; }
.install-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.install-head img { border-radius: 12px; flex: none; }
.install-head h2 { margin-top: 6px; font-size: 22px; }
.install-steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.install-steps[hidden] { display: none; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.install-steps .step-no { flex: none; margin: 0; }
.ic-inline { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; margin: 0 2px; stroke: var(--forest); }
.install-note { margin-top: 16px; }
.install .actions { margin-top: 18px; }
.install .actions .btn { flex: 1; }
.acct-menu .acct-app { color: var(--ink); }
html.install-open { overflow: hidden; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 700px) { .install { align-items: center; } .install-panel { border-radius: 18px; padding-bottom: 24px; } }
