/* WPF Management — sticky top bar with tab strip, one working column (max 1180px).
   Tables scroll inside their own frames; everything else stacks at phone width. */
:root {
  --bg: #f2f4f7; --surface: #ffffff; --sunk: #e9edf2; --ink: #18202b; --muted: #5d6878; --line: #d6dce5;
  --accent: #2b4c7e; --accent-ink: #ffffff; --accent-soft: #dfe7f3;
  --good: #22714a; --good-soft: #dcefe4; --warn: #9a6212; --warn-soft: #f6ead2; --bad: #b42318; --bad-soft: #f8dedb;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --surface: #161d27; --sunk: #1c2532; --ink: #e6ebf2; --muted: #94a1b3; --line: #283345;
    --accent: #8fb0e6; --accent-ink: #0f141b; --accent-soft: #1f2c42;
    --good: #5cc28a; --good-soft: #173326; --warn: #e3ad52; --warn-soft: #3a2c14; --bad: #f07a6e; --bad-soft: #3d1c19;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); padding-bottom: env(safe-area-inset-bottom, 0px); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* top bar */
header.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { font: 700 .78rem/1 var(--f-mono); letter-spacing: .06em; background: var(--accent); color: var(--accent-ink); padding: 6px 7px; border-radius: 6px; }
.bname { font: 700 1.25rem/1.1 var(--f-display); letter-spacing: -.01em; }
.brand.big .bname { font-size: 1.6rem; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .88rem; }
.who form { margin: 0; }
.uname { color: var(--muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role { font: 500 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); padding: 5px 8px; border-radius: 999px; }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 8px; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { padding: 10px 12px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs a:hover { color: var(--ink); text-decoration: none; }
nav.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }

main { padding-block: 22px 60px; display: grid; gap: 20px; }
main > * { min-width: 0; }
h1 { font: 600 1.6rem/1.15 var(--f-display); margin: 0; text-wrap: balance; }
h2 { font: 600 1.05rem/1.2 var(--f-display); margin: 0; }
h3 { font: 600 1.05rem/1.2 var(--f-display); margin: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.crumb { color: var(--muted); font-size: .88rem; margin-bottom: -8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.bad { color: var(--bad); }
.good { color: var(--good); }
.grow { flex: 1; min-width: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r); font: 500 .9rem/1.2 var(--f-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* summary tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .l { font: 500 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi .v { font: 600 1.6rem/1.2 var(--f-display); margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .v.bad { color: var(--bad); }
.kpi .s { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.meter { height: 6px; background: var(--sunk); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* panels and lists */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > .ph { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cols > * { min-width: 0; }
.cols.wide-first > :first-child { grid-column: 1 / -1; }
.list .it { display: flex; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.list .it:last-child { border-bottom: 0; }
.list .it > div { min-width: 0; }
.sub { color: var(--muted); font-size: .8rem; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.empty-act { margin-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px; padding: 16px; }
.facts .wide { grid-column: 1 / -1; }
.facts .l { font: 500 .68rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.facts .v { margin-top: 5px; overflow-wrap: anywhere; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 16px; }
.share { font: 600 1.4rem/1.3 var(--f-display); font-variant-numeric: tabular-nums; }
.notice { padding: 12px 16px; border-radius: var(--r); background: var(--accent-soft); font-size: .9rem; }
.bal { font: 500 .95rem var(--f-mono); }

/* property cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; align-content: start; color: var(--ink); }
.pcard:hover { border-color: var(--accent); text-decoration: none; }
.pcard .addr { color: var(--muted); font-size: .85rem; }
.pcard dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; }
.pcard dt { font: 500 .66rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pcard dd { margin: 4px 0 0; font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: .9rem; }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { font: 500 .7rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--sunk); }
td.mono { white-space: nowrap; }
td.n, th.n { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }
tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
table.bars td { padding-block: 7px; }
.barcell { width: 100%; min-width: 140px; }
.barcell .b { height: 7px; border-radius: 4px; margin: 2px 0; }
.b.acc, .sw.acc { background: var(--accent); }
.b.warn, .sw.warn { background: var(--warn); }
.legend { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

/* status pills and filter chips */
.pill { display: inline-block; font: 500 .72rem/1 var(--f-mono); letter-spacing: .03em; padding: 4px 8px; border-radius: 999px; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; color: var(--muted); background: var(--surface); }
.chip:hover { text-decoration: none; border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* toolbars */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.monthnav { display: flex; gap: 6px; align-items: center; }
.monthnav form, .filters { margin: 0; }
.filters select, .monthnav input, .head select { width: auto; }

/* forms */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; max-width: 760px; }
.form label { display: grid; gap: 5px; font-size: .84rem; color: var(--muted); font-weight: 500; align-content: start; }
.form .full { grid-column: 1 / -1; }
.form .foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.hint { font-size: .78rem; font-weight: 400; }
.err { color: var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: 6px; font-size: .88rem; }
.danger-zone { padding: 14px 18px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; max-width: 760px; border-color: var(--bad-soft); }
.danger-zone p { margin: 2px 0 0; font-size: .85rem; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.check input { width: auto; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* sign-in */
.login { min-height: 80vh; display: grid; place-items: center; }
.login-card { padding: 28px; max-width: 420px; width: 100%; display: grid; gap: 14px; }
.login-card p { margin: 0; }
.google { justify-content: center; padding: 12px; }

/* feedback */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r); z-index: 30; font-size: .9rem; max-width: calc(100% - 32px); }
.copyable { overflow-wrap: anywhere; }
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 40; opacity: 0; }
#progress.on { opacity: 1; width: 85%; transition: width 4s cubic-bezier(.1, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { #progress.on { transition: none; width: 60%; } }

.prose { padding: 24px; max-width: 760px; }
.prose h1 { margin-bottom: 12px; }
.prose h2 { margin: 18px 0 6px; }
.prose p { margin: 0 0 10px; max-width: 68ch; }

/* import */
.steps { padding: 14px 18px; }
.steps ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.steps p { margin: 6px 0; }
.import-form { padding: 18px; display: grid; gap: 14px; max-width: 760px; }
.import-form label { display: grid; gap: 8px; }
.import-form summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.import-form textarea { margin-top: 8px; font-family: var(--f-mono); font-size: .82rem; }
.import-form .foot { display: flex; justify-content: flex-end; gap: 8px; }
.confirm { padding: 16px 18px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.confirm p { margin: 4px 0 0; }
.row.center { justify-content: center; }

/* documents */
.upload { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.upload label { display: grid; gap: 5px; font-size: .82rem; color: var(--muted); font-weight: 500; min-width: 140px; }
.upload label.grow { flex: 1 1 220px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.photo { display: grid; gap: 4px; color: var(--muted); font-size: .78rem; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--sunk); border: 1px solid var(--line); }

/* deal analyzer */
.deal { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .deal { grid-template-columns: 1fr; } }
.deal-inputs, .results { display: grid; gap: 14px; min-width: 0; }
.deal-results { position: sticky; top: 120px; max-height: calc(100vh - 130px); overflow-y: auto; }
@media (max-width: 900px) { .deal-results { position: static; max-height: none; } }
.form-section { padding: 14px 16px; display: grid; gap: 10px; }
.form-section h3 { font-size: .95rem; }
.form-section label { display: grid; gap: 5px; font-size: .82rem; color: var(--muted); font-weight: 500; align-content: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: 1fr 1fr; } }
.inwrap { position: relative; display: block; }
.inwrap.usd input { padding-left: 22px; }
.inwrap.pct input { padding-right: 26px; }
.inwrap.usd::before { content: '$'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.inwrap.pct::after { content: '%'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.inwrap input { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.kpis.compact { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpis.compact .kpi { padding: 10px 12px; }
.kpis.compact .kpi .v { font-size: 1.25rem; margin-top: 6px; }
table.calc td { padding: 7px 16px; }
table.calc tr.sum td { font-weight: 600; border-top: 1px solid var(--line); }
table.calc tr.sub td { color: var(--muted); font-size: .85rem; padding-block: 4px; border-bottom: 0; }
.warnings { display: grid; gap: 6px; }
.warnings:empty { display: none; }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding-block: 10px; }

/* floating helpers on every page */
.helpers { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; z-index: 20; }
.helper { font: 600 .88rem/1 var(--f-body); padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 4px 14px rgb(0 0 0 / .12); }
.helper.ai { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
main { padding-bottom: 90px; }
dialog.sheet { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgb(0 0 0 / .25); }
dialog.sheet::backdrop { background: rgb(10 14 20 / .45); }
.sheet-body { padding: 16px 18px; display: grid; gap: 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-body label { display: grid; gap: 5px; font-size: .84rem; color: var(--muted); font-weight: 500; }
.sheet-body fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.sheet-body legend { font-size: .84rem; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.people .chip input { width: auto; margin-right: 4px; }
.sheet-body .foot { display: flex; justify-content: flex-end; }
.ai-sheet { width: min(680px, calc(100vw - 24px)); }
.ai-sheet .sheet-body { grid-template-rows: auto 1fr auto; height: min(640px, calc(100vh - 40px)); }
.ai-log { overflow-y: auto; display: grid; gap: 10px; align-content: start; padding-right: 4px; }
.ai-msg { padding: 10px 12px; border-radius: 10px; max-width: 92%; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.ai-msg.me { background: var(--accent-soft); justify-self: end; }
.ai-msg.bot { background: var(--sunk); }
.ai-cost { font-size: .72rem; color: var(--muted); margin-top: 6px; font-family: var(--f-mono); }
.ai-form { display: flex; gap: 8px; align-items: flex-end; }
.ai-form textarea { resize: vertical; }
.label { font-size: .84rem; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
@media (max-width: 560px) {
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .ai-sheet .sheet-body { height: 88vh; }
  .helper { padding: 10px 13px; }
}

/* permissions table */
.perm-form { padding: 18px; display: grid; gap: 16px; max-width: 860px; }
.perm-form .foot { display: flex; justify-content: flex-end; gap: 8px; }
.perm-form label { display: grid; gap: 5px; font-size: .84rem; color: var(--muted); font-weight: 500; }
table.perm td, table.perm th { padding: 8px 12px; }
table.perm .c { text-align: center; width: 90px; }
table.perm input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* activity filters */
form.panel.filters { padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
form.panel.filters label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 500; }
form.panel.filters select, form.panel.filters input { width: 100%; }
form.panel.filters .foot { display: flex; gap: 6px; justify-content: flex-end; grid-column: -2 / -1; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }
.perm-form label.check, .sheet-body .people label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.perm-form label.check input, .people input { width: auto; flex: none; }

/* tenant portal */
.portal { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.portal h1 { margin: 6px 0 4px; }
.portal-top { max-width: 760px; margin: 0 auto; padding: 14px 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.portal-top .who { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.portal-top form { margin: 0; }
.portal-hello p { margin: 0; }
.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.pcard { padding: 18px; display: grid; gap: 8px; align-content: start; }
.pcard .l { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pcard .big { font: 700 2rem/1.1 var(--f-display); }
.pcard .sub { margin: 0; }
.btn.wide { width: 100%; justify-content: center; text-align: center; padding: 12px 16px; font-size: .95rem; }
.stack-form { display: grid; gap: 12px; }
.stack-form label { display: grid; gap: 5px; font-size: .86rem; color: var(--muted); font-weight: 500; }
.stack-form label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-weight: 400; }
.stack-form label.check input { width: auto; margin-top: 3px; flex: none; }
.pad { padding: 16px 18px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.okbox { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.msg-form { display: grid; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.msg-form .btn { justify-self: end; }
.msg-form .hint { margin: 0; }
.thread { display: grid; gap: 10px; padding: 14px 16px; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 12px; }
.bubble.me { justify-self: end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.bubble.them { justify-self: start; background: var(--sunk); border-bottom-left-radius: 4px; }
.bubble .sub { margin-top: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
a.it.link { color: inherit; text-decoration: none; }
a.it.link:hover { background: var(--sunk); }
.it .r { text-align: right; display: grid; gap: 4px; justify-items: end; }
.photo.vid { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--sunk); border: 1px solid var(--line); font-weight: 600; color: var(--ink); }
@media (max-width: 560px) { .portal-top { padding: 12px 0 4px; } .pcard .big { font-size: 1.7rem; } }

/* AI costs */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 14px 16px 6px; }
.spark .sbar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 1px; opacity: .85; }
.spark-axis { display: flex; justify-content: space-between; padding: 0 16px 12px; font: .72rem var(--f-mono); color: var(--muted); }
.est { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.est label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.est-out .kpis { margin: 6px 0 0; }

/* deal comps + repairs */
.deal-ai section { display: grid; gap: 10px; padding: 6px 0 18px; }
.deal-ai section + section { border-top: 1px solid var(--line); padding-top: 18px; }
.deal-ai h3 { margin: 8px 0 0; font-size: .95rem; }
.deal-ai h3.sec { margin: 0; font-size: 1.05rem; }
.deal-ai p { margin: 0; }
ul.tight { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs img { width: 72px; height: 54px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.repair-form { max-width: 640px; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; text-align: right; min-height: 0; }
  table.stack td > * { min-width: 0; }
  table.stack td::before { content: attr(data-l); flex: none; max-width: 42%; text-align: left; color: var(--muted); font: 500 .7rem/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; }
  table.stack td[data-l=""]::before { display: none; }
  table.stack td:first-child { text-align: left; display: block; font-size: 1rem; padding-bottom: 4px; }
  table.stack td:first-child::before { display: none; }
  table.stack td.actions { justify-content: flex-end; padding-top: 6px; }
  table.stack td:has(> div, > .sub, > br) { display: block; text-align: left; }
  table.stack td:has(> div, > .sub, > br)::before { display: block; max-width: none; margin-bottom: 2px; }
  table.stack tr.full td { display: block; text-align: center; }
  table.stack tr.full td::before { display: none; }
  table.stack tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 10px 14px; }
  table.stack tfoot td { width: auto; display: block; }
  .tw { overflow-x: visible; }
  .head { flex-wrap: wrap; gap: 10px; }
  .head .row, .head > .btn { width: 100%; }
  .facts { grid-template-columns: 1fr 1fr; }
  .cols, .grid2, .grid3 { grid-template-columns: 1fr; }
  .helpers { gap: 6px; }
  .helper { font-size: .8rem; padding: 9px 12px; }
  body { overflow-x: hidden; }
}

/* help */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.help-toc a { font-size: .9rem; }
section.help { margin-bottom: 14px; scroll-margin-top: 110px; }
section.help p { margin: 0 0 10px; }
section.help dl { margin: 0; display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px 18px; }
section.help dt { font-weight: 600; }
section.help dd { margin: 0; color: var(--ink); line-height: 1.5; }
section.help .note { margin: 14px 0 0; }
section.help .note p { margin: 0; }
.helplink { font-size: .85rem; }
.portal-top .who a { font-size: .9rem; }
.pay-how { background: var(--sunk); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.pay-how .l { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
@media (max-width: 640px) { section.help dl { grid-template-columns: 1fr; gap: 2px; } section.help dd { margin-bottom: 10px; } }

.paybtns { display: grid; gap: 8px; }
.paybtns .btn.venmo:not(.primary) { border-color: #3d95ce; color: #1f6fa8; }
.paybtns .btn.cashapp:not(.primary) { border-color: #00c244; color: #00872f; }
.paybtns .btn.paypal:not(.primary) { border-color: #0070ba; color: #00457c; }

/* deal strategy + comparison */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.seg small { color: var(--muted); font-size: .76rem; }
.seg input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
table.compare th.n { white-space: normal; min-width: 92px; }
table.compare td.best { background: var(--accent-soft); font-weight: 600; }
table.compare tr.sub td { color: var(--muted); font-size: .82rem; }
.compare-wrap { padding-bottom: 4px; }
.compare-wrap ul.tight { margin-top: 10px; }
.pad-x { padding: 0 18px 12px; margin: 0; }

/* receipts */
.receipt-cards { display: grid; gap: 12px; }
.receipt-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 14px; }
.rc-thumb img { width: 120px; max-height: 170px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.rc-pdf { width: 120px; height: 150px; display: grid; place-items: center; border-radius: 6px; background: var(--sunk); font-weight: 700; color: var(--muted); }
.rc-fields { display: grid; gap: 8px; align-content: start; }
.rc-fields .btn[data-remove] { justify-self: start; }
.rc-match .note { margin: 0; display: grid; gap: 4px; }
.budget-form { margin-top: 6px; }
.budget-form .inwrap { width: 120px; }
@media (max-width: 640px) { .receipt-card { grid-template-columns: 1fr; } .rc-thumb img { width: 100%; max-height: 220px; } }

.llc-props { gap: 6px; }
.llc-props .chip input { width: auto; margin-right: 4px; }

/* worker portal */
.hours-row { margin-top: 4px; }
fieldset.materials { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.bulk-bar { border-bottom: 1px solid var(--line); align-items: center; }

/* lease builder */
.lease-form { display: grid; gap: 12px; max-width: 980px; }
.lease-form .form-section .chips { gap: 6px; }
.lease-form .chip input, .doc-tabs .chip input { width: auto; margin-right: 4px; }
.tenant-row, .pet-row { margin-bottom: 6px; }
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }
article.doc { padding: 28px 32px; max-width: 860px; line-height: 1.55; font-size: .95rem; margin-bottom: 16px; }
article.doc h1.doc-title { font-size: 1.5rem; margin: 0 0 14px; }
article.doc h2 { font-size: 1.05rem; margin: 20px 0 6px; }
article.doc h3 { font-size: .98rem; margin: 14px 0 4px; }
article.doc p { margin: 0 0 10px; }
article.doc ul { margin: 0 0 10px; padding-left: 22px; }
.doc-check { display: flex; gap: 8px; align-items: baseline; margin: 2px 0; }
.doc-check .box { width: 14px; height: 14px; border: 1px solid var(--ink); display: inline-grid; place-items: center; font-size: .8rem; flex: none; }
table.doc-table { border-collapse: collapse; margin: 6px 0 12px; width: 100%; }
table.doc-table th, table.doc-table td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; font-size: .88rem; }
table.doc-table th { background: var(--sunk); }
hr.doc-break { border: 0; border-top: 2px dashed var(--line); margin: 18px 0; }
.blank { background: #fff3c4; }
.sigpad canvas { width: 100%; max-width: 600px; height: 160px; border: 1px dashed var(--muted); border-radius: 8px; background: #fff; touch-action: none; }
.portal.sign { max-width: 900px; }
textarea.tpl { font-size: .82rem; line-height: 1.45; }
@media (max-width: 640px) { article.doc { padding: 16px; font-size: .92rem; } }
.seg label { position: relative; }
.seg input { left: 0; top: 0; }
.lease-form .chip { white-space: normal; }
.lease-form { grid-template-columns: minmax(0, 1fr); }
.lease-form .tw { overflow-x: auto; }

/* Menu: wrap onto a second line on computers; scroll sideways only on phones. */
@media (min-width: 641px) { nav.tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; } nav.tabs a { padding: 9px 11px; } }

form.clock, .clock { display: grid; gap: 10px; margin-bottom: 14px; }
.clock.on { border-color: var(--accent); background: var(--accent-soft); }
details.manual { margin: 18px 0; }
details.manual > summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 6px 0; }
details.manual[open] > summary { margin-bottom: 10px; }

/* Language switch (portals) and translated text */
.lang-switch { font-weight: 500; color: var(--accent); text-decoration: none; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; white-space: nowrap; }
.lang-top { display: flex; justify-content: flex-end; padding: 12px 16px 0; }
details.orig { margin-top: 6px; font-size: 13px; }
details.orig > summary { cursor: pointer; color: var(--muted); }
details.orig .pre { margin-top: 4px; padding: 6px 8px; background: var(--bg); border-radius: 6px; }
/* Long status labels (e.g. in Spanish) wrap instead of running off a phone screen */
.list .it > .r { flex: 0 1 auto; max-width: 48%; text-align: right; }
@media (max-width: 640px) { .list .it .r .pill { white-space: normal; text-align: center; line-height: 1.25; } }

/* Quick sign-in */
.setup-code .sc-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.setup-code .qr { background: #fff; padding: 8px; border-radius: 8px; line-height: 0; }
.setup-code .qr svg { width: 180px; height: 180px; }
.setup-code .code { font-size: 34px; font-weight: 600; letter-spacing: .08em; margin: 4px 0 8px; }
details.forgot { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.forgot > summary, .signin-panel details > summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; }
details.forgot[open] > summary { margin-bottom: 10px; }
.signin-panel.welcome { border-color: var(--accent); }
[data-pk-wrap] { margin-top: 10px; }
@media print { header.top, nav.tabs, .row, .crumb, .ask-fab, .ai-fab { display: none !important; } .setup-code { border: 0; } }

/* "Fill this in from a document" picker, and fields AI filled in */
.reader { border: 1px dashed var(--accent); border-radius: 10px; padding: 12px 14px; background: var(--accent-soft); margin-bottom: 4px; }
.reader label { display: grid; gap: 6px; }
.reader .hint.good { color: var(--good, #1f7a44); }
.reader .hint.bad { color: var(--bad, #b42318); }
.ai-filled { background: #fff8d6 !important; }
@media (prefers-color-scheme: dark) { .ai-filled { background: #3a3315 !important; } }

/* Properties: vacant-unit listing lines and the info checklist */
.pcard ul.vac { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.pcard ul.vac .good { color: var(--good, #1f7a44); }
.pcard ul.vac .bad, .sub.bad { color: var(--bad, #b42318); }
details.checklist > summary { cursor: pointer; list-style: none; }
details.checklist > summary::-webkit-details-marker { display: none; }
ul.checks { list-style: none; margin: 0; padding: 10px 16px 14px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
ul.checks li.ok { color: var(--muted); }
ul.checks li.no { font-weight: 500; }
ul.checks li.no span { color: var(--bad, #b42318); }
ul.checks li.ok span { color: var(--good, #1f7a44); }
.kpis.inpanel { padding: 12px 16px 4px; margin: 0; }
.pcard dl { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
form.add-unit { align-items: flex-end; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
form.add-unit label { display: grid; gap: 4px; font-size: 13px; }
form.add-unit .grow { flex: 1 1 200px; }
form.add-unit .w-sm { width: 70px; }
