:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.hidden { display: none !important; }
.inline { display: inline; }

/* ---- login ---- */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e3a8a, #2563eb 70%, #3b82f6);
}
.login-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 40px 44px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}
.login-card h1 { margin: 0 0 8px; font-size: 26px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card .error { color: var(--bad); font-weight: 600; }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 16px;
  min-height: 40px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn-primary { font-size: 17px; padding: 12px 24px; }
.btn-small { padding: 6px 12px; font-size: 16px; min-height: 36px; font-weight: 500; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); background: #f3f4f6; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.nav-link {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); background: #f3f4f6; }
.nav-link.active { color: #fff; background: var(--accent); }
/* Rental-mode gated nav (prompt 42): dimmed but still navigable — never a
   hard remove, so a deep link to a gated route still loads (no 403); it only
   signals "not for this property's rental mode". */
.nav-link.nav-dim { opacity: .38; pointer-events: none; }
.nav-link.nav-dim:hover { color: var(--muted); background: transparent; }
.nav-link.nav-dim.active { opacity: .38; color: #fff; }

/* Prompt 45: doomed creates disabled by rental-mode gating read as disabled. */
button[disabled],
select[disabled],
input[disabled] { opacity: .55; cursor: not-allowed; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.header-actions .email { color: var(--muted); font-size: 15px; }
.org-label { color: var(--muted); font-size: 15px; }

/* ---- layout ---- */
main {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  /* auto-fit collapses empty tracks: one card fills the row, two split it
     evenly, three share it. */
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 20px;
}
main .wide { grid-column: 1 / -1; }
/* Below 1000px the two-column split stacks so each card keeps a readable
   measure instead of squeezing into a narrow half. */
@media (max-width: 1000px) {
  main { grid-template-columns: 1fr; padding: 16px; }
}
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h2 { margin: 0 0 12px; font-size: 19px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink); }
.card h3 { margin: 16px 0 8px; font-size: 16px; color: var(--muted); }

.notice {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}
/* Above .cal-drawer (900) so Stripe / API toasts stay visible with a drawer open. */
.notice:not(.hidden) {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  max-width: min(520px, calc(100vw - 24px));
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}
.notice.err { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }
.notice.ok { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }

/* ---- lists ---- */
.rows { list-style: none; margin: 8px 0 12px; padding: 0; }
.rows li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.rows li .sub { color: var(--muted); font-size: 14px; }
.rows li:has(.identity-panel) { flex-wrap: wrap; }
.rows li .identity-panel { flex-basis: 100%; }
.rows li .rental-mode-select {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 13px;
  min-height: 28px;
  vertical-align: middle;
}
/* Unit rows carry many buttons: let them wrap instead of crushing the label. */
#units-list li { flex-wrap: wrap; }
/* Lease rows: label on its own line, tags and buttons wrap beneath it
   (the list sits in a narrow column; nothing may clip off the right edge). */
#leases-list li.lease-row { flex-wrap: wrap; justify-content: flex-start; row-gap: 8px; padding: 12px 8px; }
#leases-list li.lease-row > :first-child { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
#leases-list li.lease-row > .btn { flex: 0 0 auto; white-space: nowrap; }
/* prompt 127 follow-up: /portfolio?unit=<id> (a QR sticker) highlights the
   unit's row so the operator can see which one the sticker belongs to. */
.rows li.unit-focus { background: #fff7d6; outline: 2px solid var(--warn, #f0b400); }
/* Prompt 115: unanchored market rent is a hint, not a benchmark. */
.rows li .sub.market-limited { opacity: 0.65; font-style: italic; }
.rows li .sub.variance-pos { color: var(--ok); font-weight: 600; }
.rows li .sub.variance-neg { color: var(--bad); font-weight: 600; }
.rows li.empty { justify-content: flex-start; color: var(--muted); font-style: italic; border-bottom: none; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.tag-ok { background: #dcfce7; color: var(--ok); }
.tag-warn { background: #fef3c7; color: var(--warn); }
.tag-bad { background: #fee2e2; color: var(--bad); }
.tag-ghost { background: #f3f4f6; color: var(--muted); }

/* Prompt 119: unit media link panel (links only, no uploads). */
.rows li.unit-media-row { display: block; padding: 8px 10px 10px 18px; background: #fafafa; }
.unit-media { display: flex; flex-direction: column; gap: 6px; }
.unit-media-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unit-media-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.unit-media-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.unit-media-list a { overflow-wrap: anywhere; }
.unit-media-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid #e5e7eb; }
.unit-media-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.unit-media-form input[type="text"] { min-width: 220px; flex: 1 1 220px; }

/* Prompt 53: iCal import feed rows that last failed to sync (deep-link
   /stays?focus=feeds). Emphasized so a stuck feed is obvious on Stays. */
.rows li.feed-error { background: #fff7f7; border-left: 3px solid var(--bad); }

/* ---- forms ---- */
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=date], input[type=month], input[type=number],
input[type=time], input[type=url],
input[type=email], input[type=password], input[type=search], select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 40px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.inline-form input[name=address] { flex: 1 1 180px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
/* Stay settings (unit setup): the door code + Show toggle sit on ONE row. */
.door-code-row { display: flex; align-items: center; gap: 8px; }
.door-code-row input { flex: 1 1 auto; min-width: 0; }
.select-label { color: var(--muted); font-size: 15px; }
/* House-first: "This is a multi-unit building" sits inline in the property form. */
.check-inline { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; }
.check-inline input[type=checkbox] { margin: 0; }

/* ---- property filter (prompt 21) ---- */
.filter-label {
  display: inline;
  flex: none;
  margin-right: 8px;
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}
#property-filter {
  max-width: 280px;
  vertical-align: middle;
  margin-right: 12px;
  margin-bottom: 4px;
}

/* ---- payment allocation rows ---- */
.alloc-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.alloc-row .amt input { width: 110px; }
.hint { color: var(--muted); font-size: 15px; }

/* ---- tables ---- */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.data th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 13px; letter-spacing: .3px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: none; }
/* Prompt 50: past-due aging rows under /reports?focus=aging — class only. */
table.data tbody tr.aging-past-due td { background: #fef2f2; }

/* Rent ledger (eviction slice 3): the totals line above the month table. */
#ledger-totals { font-weight: 600; margin: 6px 0 2px; }

/* ---- inbox conversations (threads phase 1, read-only) ---- */
.inbox-thread-msg {
  border-top: 1px solid var(--line);
  padding: 10px 2px;
  cursor: pointer;
}
.inbox-thread-msg:first-child { border-top: none; }
.inbox-thread-msg.sel { background: #eff6ff; }
.inbox-thread-msg pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

/* ---- payment CSV import (prompt 107) ---- */
/* Collapsible panel: the <summary> carries the card's own h2 treatment so the
   closed state reads like every other card heading. */
details.card > summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink);
}
details.card[open] > summary { margin-bottom: 12px; }
.import-csv {
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  margin: 8px 0;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
.import-table-wrap { max-height: 340px; overflow: auto; margin-top: 10px; }

/* ---- snapshot strip (prompt 17) ---- */
.card .snapshot-strip { display: flex; flex-wrap: wrap; gap: 8px; }
/* ---- attention strip (prompt 37) ---- */
.attention-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 20px; }
.snap-cell {
  border: 1px solid var(--line, #dcdcdc);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 96px;
  background: var(--panel, #fff);
}
.snap-num { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.snap-label { color: var(--muted, #666); font-size: 14px; }
.btn.btn-small { font-size: 16px; padding: 5px 12px; border-radius: 6px; }
a.btn { text-decoration: none; color: inherit; }

/* ---- quiet-list toggles (prompt 23) ---- */
.filter-toggle {
  display: inline-block;
  margin: 6px 0 2px;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}
.filter-toggle input {
  margin-right: 4px;
  vertical-align: -1px;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal-box { width: min(420px, 92vw); }
.modal-box .hint { margin: 0 0 10px; color: var(--muted); }
.modal-box label { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---- removable filter chip (prompt 111, /leases?expiringWithinDays=N) ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 14px;
  font-weight: 600;
}
.chip-x {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
}
.chip-x:hover { background: rgba(55, 48, 163, .15); }

/* ---- inline renew form on an ACTIVE lease row (prompt 111) ---- */
.renew-form {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 6px 0 2px;
  font-size: 14px;
}
.renew-form label { font-size: 14px; margin-bottom: 0; }
.renew-form select, .renew-form input { font-size: 15px; padding: 5px 8px; }

/* Lease documents (signed lease / addenda) — inline panel under a lease row. */
.docs-panel {
  display: flex;
  flex-basis: 100%;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 2px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.docs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.docs-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.docs-list li a { overflow-wrap: anywhere; }
.docs-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-form select, .docs-form input[type="file"] { font-size: 14px; }
.app-screening-reports .screening-list { list-style: none; margin: 0; padding: 0; }
.app-screening-reports .scr-report { border-top: 1px solid #e5e7eb; padding: 6px 0; }
.app-screening-reports .scr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-screening-reports .scr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; margin-top: 6px; }
.app-screening-reports .scr-field { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.app-screening-reports .scr-field input, .app-screening-reports .scr-field select { font-size: 14px; }
.app-screening-reports .scr-controls { display: flex; gap: 6px; margin-top: 6px; }
/* Move-in checklist + key release (S5b) — inline panel under a lease row. */
.move-in-panel {
  display: flex;
  flex-basis: 100%;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 2px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.move-in-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.move-in-head strong { font-size: 15px; }
.mi-rows, .mi-blockers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mi-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.mi-mark { font-weight: 700; width: 1em; text-align: center; }
.mi-ok .mi-mark { color: var(--ok); }
.mi-bad .mi-mark { color: var(--bad); }
.mi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; }
.mi-field { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.mi-field input, .mi-field select, .mi-field textarea { font-size: 14px; padding: 5px 8px; }
.mi-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mi-released { margin: 0; font-weight: 600; color: var(--ok); }
.mi-override {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}
/* Disabled-looking yet clickable: the click asks the server for the 409 list. */
.btn-locked { opacity: .55; filter: grayscale(.5); cursor: not-allowed; }

/* Lease import confirm screen: one radio group per section, one per tenant. */
.li-section { margin: 10px 0 14px; }
.li-section > h3 { font-size: 15px; margin: 0 0 6px; }
.li-choices { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* One left-aligned row per choice: radio, bold name, muted evidence. The
   generic `label { flex-direction: column }` rule (forms section) must be
   overridden explicitly — without flex-direction:row the row stacks and
   align-items:center centres the radio. #li-result scoping keeps these
   winning over any later generic label/input rule. */
.li-choices li { display: block; font-size: 15px; min-width: 0; }
.li-choices .li-evidence { color: var(--muted); font-size: 14px; }
.li-choices .li-extra { color: var(--muted); font-size: 14px; }
.li-choices label,
#li-result .li-choices label {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}
.li-choices label > input[type="radio"],
#li-result .li-choices label > input[type="radio"] {
  flex: none;
  width: auto;
  min-width: 0;
  margin: 0;
}
.li-choices .li-name { font-weight: 600; }
.li-choices .li-name, .li-choices .li-evidence { min-width: 0; overflow-wrap: anywhere; }
.li-warn { color: var(--bad); font-size: 14px; margin: 4px 0 0; }
.li-warn.info { color: var(--muted); }
.li-diff { border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.li-diff th, .li-diff td { text-align: left; padding: 4px 12px 4px 0; }
.li-search { font-size: 14px; padding: 6px 8px; max-width: 260px; }
.li-tenant-row { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 8px; margin-bottom: 8px; }
.li-tenant-row input { font-size: 15px; }
/* Extracted lease text: full column width and tall enough to read a page
   without scrolling inside a cramped box (~12 rows at the base type size). */
#li-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 340px;
  font-size: 16px;
  line-height: 1.55;
}

/* Screening (prompts 120-122) */
.sc-panel { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; }
.sc-eval { list-style: none; margin: 0; padding: 0; flex-basis: 100%; }
.sc-eval-ok { color: #1a7f37; }
.sc-eval-bad { color: #b42318; }
.sc-eval-unknown { color: #6b7280; }
.sc-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.sc-notice { white-space: pre-wrap; max-height: 60vh; overflow: auto; }
#sc-form label { display: inline-flex; gap: 4px; align-items: center; }
#sc-policy { width: 100%; }

/* Supplies (prompt 104) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #e5e7eb; margin: 4px 0 12px; }
.tab { background: none; border: 1px solid transparent; border-bottom: none; padding: 8px 14px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; border-radius: 6px 6px 0 0; }
.tab:hover { background: #f3f4f6; }
.tab.active { background: #fff; border-color: #e5e7eb; color: inherit; font-weight: 600; }
.tab-panel.hidden { display: none; }
.sup-hint { font-size: 14px; }
.sup-table td, .sup-table th { padding: 4px 8px; }
.sup-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 13px; background: #f3f4f6; color: #374151; }
.sup-pill.low { background: #fee4e2; color: #b42318; }
.sup-pill.linen { background: #fef0c7; color: #92400e; }
.sup-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin: 6px 0; }
.sup-form label { font-size: 14px; margin-bottom: 0; }
.sup-form input, .sup-form select { font-size: 15px; padding: 6px 8px; }
/* Assets tab (prompt 106): inline detail sheet + horizontally scrollable
   register on narrow screens so the tag column never collapses. */
.sup-detail { border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px 12px 10px; margin: 12px 0; background: #fafafa; }
.sup-detail.hidden { display: none; }
.sup-detail h4 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
  #assets-table, #keys-table { display: block; overflow-x: auto; white-space: nowrap; }
  #assets-strip { gap: 6px; }
}

/* Calendar (prompt 107) — month grid + timeline. Colours are per source so a
   manager can tell an Airbnb stay from an iCal import at a glance. */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-left: auto; }
.cal-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 2px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); padding: 2px 4px; }
.cal-day { min-height: 76px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-day-blank { border: none; background: transparent; }
.cal-daynum { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-chip { font: inherit; font-size: 11px; text-align: left; border: none; border-radius: 4px; padding: 1px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tl-row { align-items: flex-start; }
.cal-tl-unit { flex: 0 0 160px; font-weight: 600; font-size: 13px; }
.cal-tl-track { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.cal-bar { font: inherit; font-size: 11px; border: none; border-radius: 4px; padding: 2px 6px; cursor: pointer; }
.cal-src-manual { background: #6366f1; color: #fff; }
.cal-src-ical { background: #22a35a; color: #fff; }
.cal-src-airbnb { background: #ff5a5f; color: #fff; }
/* VRBO brand-ish blue (not generic indigo). */
.cal-src-vrbo { background: #3d67ff; color: #fff; }
.cal-src-booking { background: #f59e0b; color: #1f2937; }
.cal-src-direct { background: #7c3aed; color: #fff; }
.cal-src-lease { background: #0d9488; color: #fff; }
/* Month-to-month: same teal family, dashed fill so ops can spot conversion targets. */
.cal-src-lease-mtm {
  background: repeating-linear-gradient(
    -45deg,
    #0d9488,
    #0d9488 6px,
    #14b8a6 6px,
    #14b8a6 12px
  );
  color: #fff;
  border: 1px dashed #115e59;
}
.cal-src-block { background: #8b5cf6; color: #fff; }
/* A cleaning/turnover task (not a guest): a small raised dot in its own colour. */
.cal-src-task { background: #ffedd5; color: #ea580c; }
.cal-turnover { font: inherit; font-size: 10px; text-align: left; border: 1px dashed #0f766e; border-radius: 4px; background: #ccfbf1; color: #115e59; padding: 0 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-turnover-same-day { border-style: solid; background: #0f766e; color: #fff; }
.cal-turnover-box { border-top: 1px solid #e5e7eb; margin-top: 8px; padding-top: 8px; }
/* prompt 127: turnover photo strip in the calendar drawer */
.cal-photo-strip { margin: 4px 0 10px; }
.cal-photo-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-photo-thumb { position: relative; display: inline-block; }
.cal-photo-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid #e5e7eb; display: block; }
.cal-photo-nothumb { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; font-size: 10px; color: #6b7280; border: 1px dashed #d1d5db; border-radius: 4px; }
.cal-photo-del { position: absolute; top: -6px; right: -6px; padding: 0 5px; line-height: 16px; border-radius: 8px; background: #fff; }
.cal-photo-input { display: block; font-size: 11px; margin-top: 6px; max-width: 100%; }
.cal-photo-hint { margin: 4px 0 0; }
.cal-section-title { font-size: 12px; font-weight: 600; margin: 0 0 4px; }
.cal-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); background: #fff; border-left: 1px solid #e5e7eb; box-shadow: -8px 0 24px rgba(0, 0, 0, .08); padding: 16px; overflow: auto; z-index: 900; }
.cal-drawer.hidden { display: none; }
.cal-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-drawer label { display: block; font-size: 12px; margin-bottom: 8px; }
.cal-drawer-actions { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) {
  .cal-day { min-height: 56px; }
  .cal-tl-unit { flex-basis: 100%; }
}

/* Multi-calendar — unit rows x day columns (Lodgify/iGMS-style). The grid is
   as wide as its days, so .mc-scroll does the horizontal scrolling; the unit
   cell is sticky left and the today column is tinted. Bars are absolutely
   placed over a per-row day grid and reuse the .cal-src-* palette. */
.mc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
.mc-days-label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.mc-days-label select { width: auto; font-size: 12px; padding: 2px 4px; }
.mc-scroll { overflow-x: auto; overflow-y: hidden; border: 1px solid #e5e7eb; border-radius: 8px; max-width: 100%; }
.mc-grid { display: block; width: max-content; font-size: 11px; }
.mc-head, .mc-row { display: flex; align-items: stretch; }
.mc-unit { flex: 0 0 168px; width: 168px; position: sticky; left: 0; z-index: 3; background: #fff; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #f3f4f6; padding: 4px 6px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-row .mc-unit { background: #fefce8; }
.mc-unit { display: flex; align-items: center; gap: 4px; }
.mc-unit-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mc-unit-edit { flex: 0 0 auto; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; opacity: .45; }
.mc-unit:hover .mc-unit-edit, .mc-unit-edit:focus { opacity: 1; }
.mc-unit-input { width: 100%; font: inherit; font-size: 12px; padding: 1px 4px; }
.mc-unit-mtm-badge, .mc-mtm-badge {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  background: #fff;
  color: #0f766e;
  border: 1px solid #0f766e;
}
.mc-bar .mc-mtm-badge { background: rgba(255,255,255,.92); }
.mc-corner { z-index: 4; background: #f9fafb; border-bottom: 1px solid #e5e7eb; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.mc-track { position: relative; display: grid; grid-template-columns: repeat(var(--mc-days, 30), var(--mc-dayw, 34px)); }
.mc-head .mc-track { background: #f9fafb; }
.mc-hday { padding: 3px 2px; text-align: center; border-bottom: 1px solid #e5e7eb; border-right: 1px solid #f3f4f6; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.15; }
.mc-hday b { display: block; color: #111827; font-size: 11px; }
.mc-cell { border-right: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; }
.mc-cell.mc-weekend { background: #f8fafc; }
.mc-cell { font-size: 10px; color: #9ca3af; text-align: center; padding-top: 3px; font-variant-numeric: tabular-nums; }
.mc-cell.mc-taken { background: #d1d5db; }
.mc-cell.mc-taken.mc-today { background: #cbd5e1; }
.mc-cell.mc-today, .mc-hday.mc-today { background: #fef9c3; }
.mc-hday.mc-today b { color: #a16207; }
.mc-band .mc-corner, .mc-band .mc-track { background: #1f2937; color: #e5e7eb; border-bottom: 1px solid #111827; }
.mc-band-cell { text-align: center; padding: 3px 0; border-right: 1px solid #374151; }
.mc-count { display: inline-block; min-width: 18px; padding: 1px 4px; border-radius: 999px; background: #374151; color: #d1d5db; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mc-count-on { background: #f59e0b; color: #1f2937; }
.mc-bars { position: absolute; inset: 0; pointer-events: none; }
.mc-bar { position: absolute; pointer-events: auto; font: inherit; font-size: 11px; line-height: 1.2; border: none; border-radius: 999px; padding: 2px 9px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.18); cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bar.cal-src-task { background: #ea580c; box-shadow: 0 1px 2px rgba(0,0,0,.25); padding: 0; border-radius: 50%; font-size: 0; }
.mc-bar:hover { filter: brightness(.96); }
@media (max-width: 640px) {
  .mc-unit { flex-basis: 120px; width: 120px; }
}


/* ---- rates (prompt 108, phase 2) ---------------------------------------- */
.rate-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.rate-new { background: #dbeafe; color: #1d4ed8; }
.rate-changed { background: #fef3c7; color: #92400e; }
.rate-unchanged { background: #e5e7eb; color: #374151; }
.rates-check { display: flex; align-items: center; gap: 6px; }
.rates-check input { width: auto; }

/* ---- notifications (prompt 125) ---------------------------------------- */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
}
.notif-bell:hover { border-color: var(--accent); }
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.nav-badge {
  margin-left: auto;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.notif-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.notif-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-row {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.notif-row.unread { border-left-color: var(--accent); background: #f8fafc; }
.notif-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.notif-kind {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
}
.notif-kind.sev-warning { background: #fef0c7; color: #92400e; }
.notif-kind.sev-critical { background: #fee4e2; color: #b42318; }
.notif-when { color: var(--muted); font-size: 14px; }
.notif-title { font-weight: 600; }
.notif-body { color: #374151; font-size: 15px; margin-top: 2px; }
.notif-mark { margin-top: 8px; }
.notif-more { margin-top: 12px; }
.prefs-grid { width: 100%; border-collapse: collapse; font-size: 15px; }
.prefs-grid th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.prefs-grid td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.prefs-grid .pref-kind { font-weight: 600; }
.prefs-grid .pref-contact { width: 100%; min-width: 210px; }
.prefs-grid select { padding: 4px 6px; }

/* Full-page guest auto-message editor (Settings → Edit): the copy gets the room
   a table cell never had. */
.auto-msg-edit-body { width: 100%; min-height: 320px; box-sizing: border-box; }

/* Portfolio unit rows: inline short-name editor */
.btn-link { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 14px; padding: 0 4px; }
.btn-link:hover, .btn-link:focus { color: #1d4ed8; }
.unit-short-input { font: inherit; font-size: 15px; padding: 4px 8px; min-width: 180px; }


/* ---- left navigation (iGMS-style, collapsible) ---- */
:root { --sidenav-w: 200px; --sidenav-w-collapsed: 56px; }
.sidenav { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidenav-w); background: #1f2937; color: #e5e7eb; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; z-index: 20; transition: width .15s ease; }
.sidenav-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 10px 12px 14px; border-bottom: 1px solid #111827; }
.sidenav .brand { color: #fff; text-decoration: none; white-space: nowrap; }
.sidenav .brand-mini { display: none; font-weight: 800; }
.sidenav-toggle { border: none; background: transparent; color: #cbd5e1; font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.sidenav-toggle:hover, .sidenav-toggle:focus { background: #374151; color: #fff; }
.sidenav .main-nav { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px; padding: 8px; }
.sidenav .nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: #cbd5e1; white-space: nowrap; }
.sidenav .nav-link:hover { background: #374151; color: #fff; }
.sidenav .nav-link.active { background: #f59e0b; color: #1f2937; }
.sidenav .nav-icon { flex: 0 0 22px; text-align: center; font-size: 16px; }
.app-shell { margin-left: var(--sidenav-w); min-width: 0; transition: margin-left .15s ease; }
.app-shell .topbar { justify-content: flex-end; }
.sidenav-collapsed .sidenav { width: var(--sidenav-w-collapsed); }
.sidenav-collapsed .app-shell { margin-left: var(--sidenav-w-collapsed); }
.sidenav-collapsed .nav-label, .sidenav-collapsed .brand-full { display: none; }
.sidenav-collapsed .brand-mini { display: inline; }
.sidenav-collapsed .sidenav-head { flex-direction: column; padding: 10px 6px; }
.sidenav-collapsed .sidenav .nav-link { justify-content: center; padding: 9px 4px; }


/* ---- multi-calendar: iGMS-sized cells ---- */
.mc-grid { font-size: 12px; }
.mc-hday { padding: 5px 2px; font-size: 11px; }
.mc-hdow { display: block; text-transform: uppercase; letter-spacing: .3px; font-size: 10px; }
.mc-hday b { font-size: 12px; white-space: nowrap; }
.mc-cell { font-size: 12px; color: #6b7280; padding-top: 9px; }
.mc-unit { font-size: 13px; padding: 8px 8px; }
.mc-bar { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 0 4px 0 11px; }
.mc-bar-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-avatar { flex: 0 0 16px; height: 16px; display: inline-flex; }
.mc-days-label input[type="date"] { width: auto; font-size: 12px; padding: 2px 4px; }


/* ---- Calendar page: the multi-calendar IS the page (iGMS-style) ---- */
main.main-full { max-width: none; margin: 0; padding: 10px 14px; display: block; }
.mc-page { padding: 10px 12px; }
.mc-title { margin: 0 8px 0 0; font-size: 17px; }
.mc-toolbar { margin: 0 0 8px; }
.mc-scroll { overflow: auto; max-height: calc(100vh - 150px); min-height: 320px; }
.mc-scroll .mc-head { position: sticky; z-index: 6; background: #f9fafb; }
.mc-scroll .mc-band { top: 0; }
.mc-scroll .mc-head:not(.mc-band) { top: 36px; }
.cal-more { margin-top: 14px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.cal-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }

/* Full-page cleaning task (iGMS-style) */
.tk-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.tk-page.hidden { display: none; }
.tk-top { display: flex; align-items: center; justify-content: center; position: relative; padding: 10px 16px; border-bottom: 1px solid #e5e7eb; }
.tk-top .btn { position: absolute; left: 12px; }
.tk-banner { display: flex; align-items: center; gap: 14px; padding: 22px 24px; background: linear-gradient(90deg, #374151, #6b7280); color: #fff; }
.tk-avatar { width: 40px; height: 40px; border-radius: 50%; background: #ef4444; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none; }
.tk-prop { font-size: 18px; font-weight: 600; }
.tk-addr { font-size: 13px; opacity: .85; }
.tk-meta { display: flex; gap: 28px; padding: 14px 24px; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.tk-meta div { display: flex; flex-direction: column; }
.tk-meta strong { color: #2563eb; font-weight: 500; font-size: 16px; }
.tk-meta span { font-size: 12px; color: #6b7280; }
.tk-form { padding: 18px 24px 24px; max-width: 760px; }
.tk-field { display: block; margin-bottom: 14px; }
.tk-field > span { display: block; font-size: 13px; color: #374151; margin-bottom: 4px; }
.tk-field input[type=text], .tk-field input[type=time], .tk-field input[type=number], .tk-field textarea { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; }
.tk-field textarea { min-height: 84px; resize: vertical; }
.tk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tk-hours { display: inline-flex; align-items: center; gap: 0; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.tk-hours .btn { border: 0; border-radius: 0; padding: 9px 16px; }
.tk-hours input[type=number] { width: 70px; text-align: center; border: 0; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; border-radius: 0; }
.tk-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.tk-spacer { flex: 1; }
.tk-side { background: #f3f4f6; padding: 18px; border-left: 1px solid #e5e7eb; }
.tk-side h3 { margin: 0 0 8px; font-size: 22px; }
.tk-cap { margin: 14px 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.tk-row { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; font: inherit; }
.tk-row strong { color: #2563eb; font-weight: 500; }
.tk-row span { font-size: 12px; color: #6b7280; }
.tk-row-cur { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb inset; }
.tk-new { flex-direction: row; color: #2563eb; }
@media (max-width: 800px) { .tk-page { grid-template-columns: 1fr; } .tk-side { border-left: 0; border-top: 1px solid #e5e7eb; } }
.tk-pick { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 9px 10px; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; cursor: pointer; text-align: left; }
.tk-pick-ico { width: 24px; height: 24px; border-radius: 50%; background: #e5e7eb; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.tk-pick-name { flex: 1; color: #2563eb; }
.tk-pick-caret { color: #6b7280; }
.tk-overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 1100; display: flex; justify-content: center; align-items: flex-start; padding: 40px 12px; overflow: auto; }
.tk-sheet { background: #fff; border-radius: 10px; width: min(520px, 100%); padding: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.tk-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tk-search { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; margin-bottom: 8px; }
.tk-member { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #f3f4f6; padding: 10px 6px; cursor: pointer; font: inherit; }
.tk-member:hover, .tk-member-sel { background: #eff6ff; }
.tk-member strong { display: block; color: #2563eb; font-weight: 500; }
.tk-member small { color: #6b7280; }
.tk-initials { width: 34px; height: 34px; border-radius: 50%; background: #e5e7eb; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.tk-add { display: grid; gap: 6px; }
.tk-add input { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; }


/* ==========================================================================
   App-wide visual language: the calendar page's look, on every other page.

   The calendar (main.main-full) is the reference and stays exactly as it is;
   every rule below is scoped to main:not(.main-full) so nothing here can
   restyle it. Shared tokens first, then surfaces, page headers, tables,
   controls and quiet danger buttons — the same greys (#f9fafb bands,
   #f3f4f6 rules, #d1d5db control borders), 6-10px radii and 17-18px titles
   the calendar already uses.
   ========================================================================== */
:root {
  --surface-alt: #f9fafb;    /* calendar header band */
  --surface-sunken: #f3f4f6; /* calendar grid rules / side panels */
  --control-line: #d1d5db;   /* calendar input borders */
  --radius-sm: 6px;          /* calendar controls */
  --radius-md: 8px;
  --danger: #b42318;
  --danger-line: #fecaca;
  --danger-bg: #fef2f2;
}

/* Full-bleed pages like the calendar: no centred column, tight gutters. */
main:not(.main-full) {
  max-width: none;
  margin: 0;
  padding: 12px 16px 20px;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

/* /leases is a fixed two-column page (new lease | set up from a signed lease).
   The auto-fit/minmax(420px,1fr) grid let a flexible track's automatic minimum
   grow to the card's min-content, so once the lease text / match results
   landed the columns widened and the page jumped from a narrow split to full
   width. Definite fractional tracks with a zero minimum keep the split stable
   from first paint; long text wraps instead of pushing the track wider. */
main.main-leases {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}
main.main-leases > .card { min-width: 0; }
main.main-leases input[type="text"],
main.main-leases input[type="date"],
main.main-leases input[type="number"],
main.main-leases input[type="file"],
main.main-leases select,
main.main-leases textarea { width: 100%; max-width: 100%; min-width: 0; }
main.main-leases #li-text,
main.main-leases #li-text-note,
main.main-leases .li-choices,
main.main-leases .li-choices li,
main.main-leases .li-choices label,
main.main-leases pre { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1000px) {
  main.main-leases { grid-template-columns: minmax(0, 1fr); }
}

/* Panels: the calendar's white surface, thin grey border, soft shadow. */
main:not(.main-full) .card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

/* Page header: each card's h2 reads like the calendar toolbar title — a
   sentence-case heading with a hairline rule under it, controls beside it. */
main:not(.main-full) .card > h2 {
  font-size: 18px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-sunken);
}
main:not(.main-full) details.card > summary {
  font-size: 18px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-sunken);
}
main:not(.main-full) details.card[open] > summary { margin-bottom: 12px; }
main:not(.main-full) .card h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 16px 0 8px;
}

/* Toolbars: the calendar's control row — compact, wrapping, evenly spaced. */
main:not(.main-full) .inline-form { gap: 8px; margin-bottom: 10px; }
main:not(.main-full) .grid3 { gap: 12px; margin-bottom: 12px; }

/* Tables echo the calendar grid: grey header band, hairline row rules. */
main:not(.main-full) table.data {
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}
main:not(.main-full) table.data th {
  background: var(--surface-alt);
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
main:not(.main-full) table.data td {
  padding: 10px 12px;
  font-size: 15px;
  border-bottom: 1px solid var(--surface-sunken);
  vertical-align: middle;
}
main:not(.main-full) table.data tbody tr:hover td { background: #fbfcfd; }
main:not(.main-full) table.data tbody tr:last-child td { border-bottom: none; }

/* Lists keep the same row rhythm as the calendar's unit rows. */
main:not(.main-full) .rows li {
  padding: 9px 10px;
  border-bottom: 1px solid var(--surface-sunken);
}
main:not(.main-full) .rows li:not(.unit-media-row):hover { background: #fbfcfd; }
main:not(.main-full) .rows li:last-child { border-bottom: none; }

/* Controls match the calendar's inputs and buttons: 6px radius, grey border. */
main:not(.main-full) input[type=text],
main:not(.main-full) input[type=date],
main:not(.main-full) input[type=month],
main:not(.main-full) input[type=number],
main:not(.main-full) input[type=email],
main:not(.main-full) input[type=password],
main:not(.main-full) input[type=search],
main:not(.main-full) select,
main:not(.main-full) textarea {
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 38px;
  font-size: 16px;
}
main:not(.main-full) .btn {
  border-radius: var(--radius-sm);
  font-size: 15px;
  padding: 8px 14px;
  min-height: 38px;
}
main:not(.main-full) .btn-small,
main:not(.main-full) .btn.small {
  font-size: 14px;
  padding: 5px 10px;
  min-height: 32px;
  font-weight: 500;
}

/* Destructive actions read as quiet danger, never a solid blue primary.
   .btn-danger / .btn-remove are the shared hooks; the attribute selectors
   catch the Remove buttons the page scripts already tag. */
main:not(.main-full) .btn-danger,
main:not(.main-full) .btn-remove,
main:not(.main-full) .li-t-remove,
main:not(.main-full) .btn[data-remove-feed-id],
main:not(.main-full) .btn[data-remove-cid-id],
main:not(.main-full) .cal-photo-del {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger-line);
  font-weight: 600;
}
main:not(.main-full) .btn-danger:hover,
main:not(.main-full) .btn-remove:hover,
main:not(.main-full) .li-t-remove:hover,
main:not(.main-full) .btn[data-remove-feed-id]:hover,
main:not(.main-full) .btn[data-remove-cid-id]:hover,
main:not(.main-full) .cal-photo-del:hover {
  background: var(--danger-bg);
  border-color: #fca5a5;
  color: #912018;
}

/* ==========================================================================
   Design system polish — the calendar look, tightened.
   Layered last on purpose: same selectors as the block above, so these
   values win without rewriting the page scripts or the markup.

     Hierarchy   card title band (18px/600 + hairline) → subtitle line →
                 content; the primary submit in a toolbar sits far right.
     Surfaces    12px radius, 1px #e6e8ec edge, two-layer soft shadow,
                 whitespace on an 8px scale (4 / 8 / 12 / 16 / 24 / 32).
     Colour      muted neutrals + one accent (brand blue) and its tints;
                 status chips are tinted fills with a matching hairline.
     Tables      sticky header, row hover, tabular numbers right-aligned.
     Empty       a soft dashed panel with the hint line inside it.
   ========================================================================== */
:root {
  /* 8px spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  /* muted neutrals */
  --ink: #1b2130;
  --muted: #64707f;
  --line: #e6e8ec;
  --line-soft: #eef0f4;
  --surface-alt: #f9fafb;
  --surface-sunken: #f2f4f7;
  --surface-hover: #f7f9fc;
  --control-line: #d6dae1;

  /* one accent: the brand blue, plus its tints */
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-ink: #1e40af;
  --accent-tint: #eff6ff;
  --accent-edge: #bfdbfe;

  /* radii + elevation */
  --radius: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);

  --topbar-h: 64px;
}

/* ---- chrome ------------------------------------------------------------ */
.topbar {
  padding: var(--sp-3) var(--sp-5);
  box-shadow: var(--shadow-xs);
  border-bottom: 1px solid var(--line);
}
.header-actions { gap: var(--sp-3); }
.org-label { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.header-actions .email { font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- page + card surfaces ---------------------------------------------- */
main:not(.main-full) {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  gap: var(--sp-5);
  align-items: start;
}
main:not(.main-full) .card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
main:not(.main-full) .card.wide { grid-column: 1 / -1; }

/* Title band: sentence-case heading over a hairline, the primary submit of
   the toolbar right-aligned on the same visual row as the content start. */
main:not(.main-full) .card > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.01em;
  margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
}
main:not(.main-full) details.card > summary {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.01em;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
}
main:not(.main-full) details.card[open] > summary { margin-bottom: var(--sp-3); }

/* Subtitle: the hint/description that follows a card title. */
main:not(.main-full) .card > h2 + .hint,
main:not(.main-full) .card > h2 + .row-display,
main:not(.main-full) .card > h2 + p {
  margin: calc(-1 * var(--sp-2)) 0 var(--sp-3);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

main:not(.main-full) .card h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: var(--sp-4) 0 var(--sp-2);
}
main:not(.main-full) .card h3:first-child { margin-top: 0; }
main:not(.main-full) .hint { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---- toolbars ---------------------------------------------------------- */
main:not(.main-full) .inline-form { gap: var(--sp-2); margin-bottom: var(--sp-3); }
main:not(.main-full) .grid3 { gap: var(--sp-3); margin-bottom: var(--sp-3); }
/* The primary action closes the toolbar, right-aligned. */
main:not(.main-full) .inline-form > .btn[type=submit]:last-child,
main:not(.main-full) .inline-form > button[type=submit]:last-child { margin-left: auto; }

/* ---- controls ---------------------------------------------------------- */
main:not(.main-full) input[type=text],
main:not(.main-full) input[type=date],
main:not(.main-full) input[type=month],
main:not(.main-full) input[type=number],
main:not(.main-full) input[type=email],
main:not(.main-full) input[type=password],
main:not(.main-full) input[type=search],
main:not(.main-full) select,
main:not(.main-full) textarea {
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 38px;
  font-size: 15px;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
main:not(.main-full) input:focus,
main:not(.main-full) select:focus,
main:not(.main-full) textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
main:not(.main-full) label { font-size: 14px; color: var(--muted); }

main:not(.main-full) .btn {
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 38px;
  box-shadow: var(--shadow-xs);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
main:not(.main-full) .btn:hover { box-shadow: var(--shadow-sm); }
main:not(.main-full) .btn-small,
main:not(.main-full) .btn.small { font-size: 13px; padding: 5px 10px; min-height: 30px; font-weight: 600; box-shadow: none; }
main:not(.main-full) .btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--control-line);
  font-weight: 500;
  box-shadow: none;
}
main:not(.main-full) .btn-ghost:hover { background: var(--surface-hover); border-color: #c6ccd6; color: var(--ink); }

/* ---- tables ------------------------------------------------------------ */
main:not(.main-full) table.data {
  width: 100%;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  /* No overflow:hidden — it would kill the sticky header below. */
  overflow: visible;
}
main:not(.main-full) table.data th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 2;
  background: var(--surface-alt);
  color: #4a5565;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 10px var(--sp-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
main:not(.main-full) table.data thead tr:first-child th:first-child { border-top-left-radius: var(--radius-md); }
main:not(.main-full) table.data thead tr:first-child th:last-child { border-top-right-radius: var(--radius-md); }
main:not(.main-full) table.data td {
  padding: 11px var(--sp-3);
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
main:not(.main-full) table.data tbody tr { transition: background .1s ease; }
main:not(.main-full) table.data tbody tr:hover td { background: var(--surface-hover); }
main:not(.main-full) table.data tbody tr:last-child td { border-bottom: none; }
/* Currency and counts line up in columns. */
main:not(.main-full) table.data .num,
main:not(.main-full) table.data td.num,
main:not(.main-full) table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
main:not(.main-full) table.data tbody tr.aging-past-due td { background: #fff5f5; }
main:not(.main-full) .import-table-wrap { border-radius: var(--radius-md); }
/* Inside its own scroll box the header sticks to the box, not the topbar. */
main:not(.main-full) .import-table-wrap table.data th { top: 0; }

/* ---- lists ------------------------------------------------------------- */
main:not(.main-full) .rows { margin: var(--sp-2) 0 var(--sp-3); }
main:not(.main-full) .rows li {
  padding: 10px var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  transition: background .1s ease;
}
main:not(.main-full) .rows li:not(.unit-media-row):not(.empty):hover { background: var(--surface-hover); }
main:not(.main-full) .rows li:last-child { border-bottom: none; }
main:not(.main-full) .rows li .sub { font-size: 13px; color: var(--muted); }

/* Empty state: a soft dashed well holding the hint line, never bare text. */
main:not(.main-full) .rows li.empty,
main:not(.main-full) .rows li.row.empty,
main:not(.main-full) .rows li.empty:hover {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  justify-content: flex-start;
  margin: var(--sp-2) 0;
  padding: var(--sp-4);
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.5;
  background: var(--surface-alt);
  border: 1px dashed var(--control-line);
  border-radius: var(--radius-md);
}
main:not(.main-full) .rows li.empty::before,
main:not(.main-full) .rows li.empty:not(:empty)::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin-bottom: var(--sp-1);
  border: 1.5px solid #cbd2dc;
  border-radius: 6px;
  background:
    linear-gradient(#cbd2dc, #cbd2dc) center/10px 1.5px no-repeat,
    linear-gradient(#cbd2dc, #cbd2dc) center/1.5px 10px no-repeat;
}
main:not(.main-full) p.hint:empty { display: none; }

/* ---- status chips ------------------------------------------------------ */
main:not(.main-full) .tag,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tag-ok { background: #ecfdf3; color: #027a48; border-color: #abefc6; }
.tag-warn { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.tag-bad { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.tag-ghost { background: var(--surface-sunken); color: #4a5565; border-color: var(--line); }

/* ---- notices, chips, modals -------------------------------------------- */
main .notice { border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); font-size: 14px; }
main .chip { background: var(--accent-tint); color: var(--accent-ink); border: 1px solid var(--accent-edge); }
main .chip-x:hover { background: rgba(37, 99, 235, .14); }
.modal { background: rgba(16, 24, 40, .40); backdrop-filter: blur(2px); }
.modal-box { border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: var(--sp-5); }
.modal-box h3 { margin-top: 0; }

/* ---- calendar (kept the same grid sizing + behaviour) ------------------- */
.mc-page {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
}
.mc-page > .hint { font-size: 14px; }
.mc-toolbar {
  gap: var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
}
.mc-title { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.mc-toolbar strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.mc-toolbar .btn-small {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  min-height: 30px;
  box-shadow: none;
}
.mc-toolbar .btn-small:hover { background: var(--surface-hover); border-color: #c6ccd6; }
/* One primary action in the calendar toolbar, in the brand accent. */
.mc-toolbar #mc-newtask {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.mc-toolbar #mc-newtask:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.mc-toolbar input[type=date],
.mc-toolbar select {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--control-line);
}
/* Legend swatches read as small chips on the same tinted family. */
.cal-legend { color: var(--muted); font-size: 12px; gap: 6px; }
.cal-swatch { border-radius: 3px; }
/* The grid frame matches the card: hairline edge, 10px radius, soft shadow. */
.mc-scroll {
  margin-top: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  background: #fff;
}
/* Unit cells go neutral (the old cream tint competed with the day bars). */
.mc-row .mc-unit { background: var(--surface-alt); color: var(--ink); }
.mc-corner, .mc-head .mc-track, .mc-head .mc-corner { background: var(--surface-alt); }
.mc-hday { border-bottom-color: var(--line); border-right-color: var(--line-soft); }
.mc-cell { border-right-color: var(--line-soft); border-bottom-color: var(--line-soft); }
/* Month view: same hairline card, calm day cells, today stays visible. */
.cal-day { border-color: var(--line); border-radius: var(--radius-sm); }
.cal-daynum { font-weight: 600; }
.cal-chip, .cal-bar { border-radius: 6px; }
.mc-page .cal-more > summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
.mc-page .cal-more[open] > summary { color: var(--ink); }
.mc-page .disclaimer { color: var(--muted); font-size: 13px; line-height: 1.6; }
.cal-month {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.cal-drawer {
  border: 1px solid var(--line);
  border-left-width: 1px;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: var(--shadow-pop);
  background: #fff;
}
.cal-drawer-head { border-bottom: 1px solid var(--line-soft); padding-bottom: var(--sp-3); }

/* ---- sidebar nav groups: STR / LTR / Shared ----------------------------
   Three collapsible groups with small uppercase headings. The heading row is
   itself the collapse toggle; the up/down arrows only appear on hover (or
   keyboard focus) so the default sidebar stays calm. Settings is not a group:
   it is the last child and never reorders. */
.sidenav .main-nav { gap: 0; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 4px; }
.nav-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 6px 2px 10px;
  border-radius: 6px;
}
.nav-group-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #93a1b3;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.nav-group-toggle:hover, .nav-group-toggle:focus-visible { color: #e5e7eb; }
.nav-group-caret { font-size: 9px; line-height: 1; transition: transform .12s ease; }
.nav-group.is-closed .nav-group-caret { transform: rotate(-90deg); }
.nav-group-body { display: flex; flex-direction: column; gap: 2px; }
.nav-group.is-closed .nav-group-body { display: none; }
/* Reorder arrows: revealed on hover, disabled at the ends. */
.nav-group-move { display: flex; gap: 1px; opacity: 0; transition: opacity .12s ease; }
.nav-group-head:hover .nav-group-move,
.nav-group-head:focus-within .nav-group-move { opacity: 1; }
.nav-group-arrow {
  padding: 3px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #93a1b3;
  font-size: 8px;
  line-height: 1;
  cursor: pointer;
}
.nav-group-arrow:hover { background: #374151; color: #fff; }
.nav-group-arrow[disabled] { opacity: .3; cursor: default; }
.nav-group-arrow[disabled]:hover { background: transparent; color: #93a1b3; }
/* Settings pinned at the bottom of the nav, never inside a group. */
.sidenav .nav-settings { margin-top: 8px; border-top: 1px solid #111827; border-radius: 0 0 8px 8px; padding-top: 10px; }
/* Icon-only sidebar: headings/arrows would be noise, so hide the row and always
   show the bodies (with a divider) instead of a stack of empty gaps. */
.sidenav-collapsed .nav-group-head { display: none; }
.sidenav-collapsed .nav-group.is-closed .nav-group-body { display: flex; }
.sidenav-collapsed .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid #111827; }

/* ---- rental-type switch (Both | LTR | STR) in the top bar --------------- */
.seg {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.seg > button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.seg > button + button { border-left: 1px solid var(--line); }
.seg > button:hover { background: #f3f4f6; color: var(--ink); }
.seg > button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Home: which properties the current rental-type view is looking at. */
#mode-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 18px; }
.mode-scope-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mode-chip {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

/* ---- inbox: three-column conversation view (iGMS-style) ---- */
.inbox3 {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 260px;
  grid-column: 1 / -1; /* span the page grid; its auto-fit track left the message column 0px wide */
  border: 1px solid #e5e7eb;
  background: #fff;
  min-height: 560px;
}
.inbox3[hidden] { display: none; }
.inbox3-list, .inbox3-main, .inbox3-side { overflow: auto; max-height: 78vh; }
.inbox3-list { border-right: 1px solid #e5e7eb; padding: 0; background: #fff; }
.inbox3-main { padding: 14px 18px; background: #fafafa; }
.inbox3-side { border-left: 1px solid #e5e7eb; padding: 14px; background: #fff; }
.inbox3-list input[type=search] { width: calc(100% - 20px); box-sizing: border-box; margin: 10px; }
.inbox3-tabs { display: flex; border-bottom: 1px solid #e5e7eb; }
.inbox3-tab {
  flex: 1; border: none; border-bottom: 3px solid transparent; background: none;
  padding: 6px 2px; font-size: 11px; color: #4b5563; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.inbox3-tab .ic { font-size: 14px; color: #1e88e5; }
.inbox3-tab[aria-pressed=true] { border-bottom-color: #1e88e5; color: #111827; font-weight: 600; }
.inbox3-rows { list-style: none; margin: 0; padding: 0; }
.inbox3-row {
  display: flex; gap: 10px; padding: 10px 10px; border-bottom: 1px solid #e5e7eb;
  border-left: 4px solid transparent; cursor: pointer; background: #fff;
}
.inbox3-row:hover { background: #f3f4f6; }
.inbox3-row.unread { background: #e8f5f3; border-left-color: #26a69a; }
.inbox3-row.sel { background: #1e88e5; color: #fff; border-left-color: #1e88e5; }
.inbox3-row.sel .time, .inbox3-row.sel .snip { color: #e3f2fd; }
.inbox3-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: #cfd8dc; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.inbox3-avatar.big { width: 52px; height: 52px; font-size: 20px; }
.inbox3-row .body { min-width: 0; flex: 1; }
.inbox3-row .top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.inbox3-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.inbox3-row.unread .name { font-weight: 700; }
.inbox3-row .time { color: #6b7280; font-size: 11px; white-space: nowrap; }
.inbox3-row .snip {
  color: #6b7280; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.inbox3-who { display: flex; align-items: center; gap: 12px; }
.inbox3-who h3 { margin: 0; color: #1e88e5; font-size: 16px; }
.inbox3-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.inbox3-act {
  border: 1px solid #90caf9; background: #e3f2fd; color: #1565c0; border-radius: 3px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.inbox3-act:disabled { opacity: .5; cursor: default; }
.inbox3-act[aria-pressed=true] { background: #1e88e5; color: #fff; }
.inbox3-stay { background: #e8f5e9; border: 1px solid #c8e6c9; padding: 10px 14px; margin: 10px 0; font-size: 13px; }
.inbox3-stay-grid { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 0; }
.inbox3-stay-grid dt { color: #6b7280; }
.inbox3-stay-grid dd { margin: 0; }
.inbox3-stay-grid .ok { background: #43a047; color: #fff; padding: 0 6px; border-radius: 2px; font-size: 11px; font-weight: 700; }
.inbox3-thread { margin: 10px 0; }
.inbox3-thread .inbox-thread-msg { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; margin: 8px 0; padding: 8px 12px; }
.inbox3-thread .inbox-thread-msg.sel { background: #eff6ff; border-color: #90caf9; }
.inbox3-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.inbox3-reply textarea { flex: 1; }
.inbox3-side-h { margin: 0 0 8px; color: #1e88e5; font-size: 18px; font-weight: 400; letter-spacing: .5px; text-transform: uppercase; }
.inbox3-sticky { background: #fff176; min-height: 120px; padding: 10px; font-size: 13px; margin-bottom: 14px; box-shadow: 1px 2px 4px rgba(0,0,0,.15); white-space: pre-wrap; }
.inbox3-history { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.inbox3-history li { padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
@media (max-width: 900px) {
  .inbox3 { grid-template-columns: 1fr; }
  .inbox3-list, .inbox3-side { border: none; max-height: none; }
}

/* ---- inbox round 2: bubbles, template chips, to-do, mini calendar ---- */
.inbox3 [hidden] { display: none !important; }
.inbox3-views { display: flex; gap: 12px; padding: 8px 12px 0; font-size: 12px; }
.inbox3-link { background: none; border: 0; padding: 0; color: #6b7280; cursor: pointer; }
.inbox3-link[aria-pressed=true] { color: #1e88e5; font-weight: 600; }
.inbox3-summary { display: block; padding: 4px 12px; }
/* Active scope line under the folders: which property the list is limited to. */
.inbox3-filter { display: flex; gap: 6px; align-items: baseline; padding: 6px 12px 0; font-size: 12px; }
.inbox3-filter .hint { text-transform: uppercase; letter-spacing: .5px; }
.inbox3-filter strong { color: #111827; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Stay context under the snippet (unit/listing + nights), iGMS-style. */
.inbox3-row .inbox3-row-meta {
  color: #6b7280; font-size: 11px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inbox3-row.sel .inbox3-row-meta { color: #e3f2fd; }
.inbox3-stay-link { margin: 6px 0 0; }
.inbox3-stay-link a { color: #1e88e5; font-size: 13px; }
.inbox3-stay-link a + a { margin-left: 12px; }
.inbox3-tab { padding-left: 6px; padding-right: 6px; font-size: 12px; }
.inbox3-openbar { border-bottom: 1px solid #e5e7eb; margin: -14px -18px 10px; padding: 0 10px; background: #fff; }
.inbox3-opentab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 2px solid #1e88e5; font-size: 13px; }
.inbox3-opentab button { border: 0; background: none; font-size: 16px; line-height: 1; cursor: pointer; color: #6b7280; }
.inbox3-opentab button:hover { color: #c62828; }
.inbox3-thread .inbox3-msg { display: flex; gap: 10px; align-items: flex-start; background: none; border: 0; padding: 0; margin: 12px 0; cursor: pointer; }
.inbox3-bubble { background: #fff; border: 1px solid #e5e7eb; border-radius: 4px 14px 14px 14px; padding: 8px 12px; max-width: 80%; min-width: 0; }
.inbox3-msg.sel .inbox3-bubble { background: #eff6ff; border-color: #90caf9; }
/* C2: host replies read as a distinct bubble on the right. Never an OTA claim. */
.inbox3-thread .inbox3-msg.outbound { cursor: default; flex-direction: row-reverse; }
.inbox3-msg.outbound .inbox3-bubble { background: #f0fdf4; border-color: #bbf7d0; border-radius: 14px 4px 14px 14px; }
.inbox3-msg.outbound .inbox3-avatar { background: #dcfce7; color: #166534; }
.inbox3-bubble-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.inbox3-bubble-subj { color: #6b7280; font-size: 12px; margin: 2px 0 4px; }
.inbox3-bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.inbox3-reply { display: block; }
.inbox3-reply textarea { width: 100%; box-sizing: border-box; }
.inbox3-reply-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.inbox3-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.inbox3-chip { display: inline-flex; border: 1px solid #90caf9; border-radius: 14px; background: #eff6ff; overflow: hidden; }
.inbox3-chip button { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 3px 8px; color: #1565c0; }
.inbox3-chip .del { padding-left: 2px; color: #6b7280; }
.inbox3-chip .del:hover { color: #c62828; }
.inbox3-side textarea, .inbox3-todo input[type=text], .inbox3-todo input[type=datetime-local] { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.inbox3-todo { display: block; margin-bottom: 14px; }
.inbox3-todo-done { display: block; font-size: 12px; margin-bottom: 6px; }
.inbox3-cal { font-size: 12px; margin-bottom: 14px; }
.inbox3-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.inbox3-cal-head button { border: 0; background: none; cursor: pointer; font-size: 16px; }
.inbox3-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.inbox3-cal-grid .dow { color: #6b7280; }
.inbox3-cal-grid .day { padding: 3px 0; border-radius: 3px; }
.inbox3-cal-grid .day.on { background: #1e88e5; color: #fff; }

/* ---- unit labels (migration 0066, iGMS-style tags) ---------------------- */
.label-filter-wrap { display: inline-flex; align-items: center; gap: .35rem; }
.label-chips { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.label-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 1px 8px; border: 1px solid var(--line, #d8dee4);
  border-radius: 999px; font-size: 12px; white-space: nowrap;
}
.label-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b949e; display: inline-block; }
.label-color { width: 34px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.label-rename { max-width: 220px; }
.unit-labels-row { display: block; }
.unit-labels {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 2px 0 8px; border: 1px dashed var(--line, #d8dee4); border-radius: 6px;
}
.unit-label-checks { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.unit-label-check { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.unit-label-actions { display: inline-flex; gap: 6px; }
.prop-apply-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }

/* ---- inbox: Airbnb-style chat bubbles ---- */
.chat-group { margin: 10px 0; }
.chat-row { display: flex; gap: 8px; margin: 6px 0; align-items: flex-end; }
.chat-row.out { justify-content: flex-end; }
.chat-avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #d1d5db; color: #111827; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.chat-col { max-width: 72%; display: flex; flex-direction: column; }
.chat-row.out .chat-col { align-items: flex-end; }
.chat-bubble { padding: 10px 14px; border-radius: 18px; line-height: 1.4; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble.in { background: #f1f1f1; color: #222; border-bottom-left-radius: 4px; }
.chat-bubble.out { background: #222; color: #fff; border-bottom-right-radius: 4px; }
.chat-meta { font-size: 11px; color: #717171; margin: 3px 4px 0; }
.chat-orig { font-size: 12px; color: #717171; margin: 3px 4px 0; }
.chat-orig summary { cursor: pointer; }
.chat-orig div { margin-top: 3px; font-style: italic; white-space: pre-wrap; }
.chat-group.sel .chat-bubble.in { outline: 2px solid #90caf9; }
.chat-notice { margin: 14px auto; max-width: 86%; border: 1px solid #e5e7eb; background: #fff; border-radius: 12px; padding: 10px 14px; text-align: left; font-size: 13px; cursor: pointer; }
.chat-notice-h { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.chat-notice-b { margin-top: 6px; color: #4b5563; max-height: 6.5em; overflow: hidden; }

/* Applications list: the row wraps; the intake details and screening checklist
   take their own full-width lines under the summary/controls instead of being
   squeezed into a narrow flex column. */
.rows li[data-app-row] { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
.rows li[data-app-row] > :first-child { flex: 1 1 220px; min-width: 180px; }
.rows li[data-app-row] > details[data-intake],
.rows li[data-app-row] > .sc-panel { flex: 1 1 100%; order: 10; }

/* Screening checklist: heading above, then label+field pairs flowing inline
   (the form is a flat run of label/select/input siblings). */
.rows li[data-app-row] > .sc-panel { display: block; }
.sc-panel h2 { font-size: 15px; margin: 0 0 4px; text-transform: none; letter-spacing: 0; }
.sc-panel form { display: block; line-height: 2.6; }
.sc-panel form label { display: inline-block; margin: 0 4px 0 14px; }
.sc-panel form label:first-child { margin-left: 0; }
.sc-panel form select, .sc-panel form input { display: inline-block; width: auto; max-width: 150px; }
.rows li[data-app-row] > details.app-docs { flex: 1 1 100%; order: 10; }

/* ---- red flags (screening S4b) ------------------------------------------ */
/* Advisory checks only -- the panel sits at the TOP of the application row. */
.rows li[data-app-row] > .rf-panel { flex: 1 1 100%; order: -1; }
.rf-panel { border: 1px solid #e5e7eb; border-left: 4px solid #ef6c00; border-radius: 6px; padding: 8px 12px; background: #fffdf7; }
.rf-head { font-size: 15px; margin: 0 0 6px; text-transform: none; letter-spacing: 0; }
.rf-flag { padding: 8px 0; border-top: 1px solid #eee; }
.rf-flag:first-of-type { border-top: 0; }
.rf-flag > strong { margin-left: 6px; }
.rf-flag textarea { display: block; width: 100%; max-width: 520px; margin: 6px 0 4px; font: inherit; }
.rf-flag button { margin-right: 6px; }
.rf-sev-high { background: #c62828; color: #fff; }
.rf-sev-med { background: #ef6c00; color: #fff; }
.rf-cleared { opacity: 0.85; }
.rf-foot { margin-top: 6px; font-style: italic; }
.app-docs .docs-form { margin-top: 6px; }

/* ---- past-tenant match (screening S3b) ---------------------------------- */
.ptm-box {
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 0 6px;
  font-size: 14px;
  background: #fff;
}
.ptm-box.ptm-strong { border-color: #fecaca; border-left-color: #b3261e; background: #fef2f2; color: #7f1d1d; }
.ptm-box.ptm-possible { border-color: #fedf89; border-left-color: #b54708; background: #fffaeb; color: #7a3b06; }
.ptm-box.ptm-weak { border-color: #e5e7eb; border-left-color: #9aa1ac; background: #f9fafb; color: #4b5563; }

/* ---- application fee cap / receipt / refund (screening S6b) --------------- */
.fee-form .fee-select { min-width: 88px; }
.fee-form input[type="text"] { width: 150px; }
.fee-form input[type="number"] { width: 110px; }
.fee-refund {
  border: 1px solid #fedf89;
  border-left: 4px solid #ef6c00;
  border-radius: 6px;
  padding: 4px 8px;
  background: #fffaeb;
  color: #7a3b06;
  font-size: 14px;
}
.fee-refund .fee-refund-note { font-weight: 600; }
.fee-receipt-form { display: block; padding: 6px 10px; }
.fee-receipt-text {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 6px;
  max-width: 640px;
  overflow-x: auto;
}

/* S8b: screening summary + conditional approval (advisory only — a human decides). */
.decision-panel { display: block; margin: 8px 0 6px; }
.screen-summary {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #f9fafb;
}
.screen-summary-title { font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.screen-summary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.screen-band {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #fff;
}
.screen-band.band-meets { background: #15803d; }
.screen-band.band-review { background: #c2410c; }
.screen-band.band-no { background: #b91c1c; }
.screen-score { font-size: 12px; font-weight: 600; }
.screen-reasons { margin: 0 0 4px 16px; padding: 0; font-size: 12px; }
.screen-reasons li { margin: 1px 0; }
.screen-summary-note { font-size: 12px; }
.cond-form { margin: 4px 0; font-size: 12px; }
.cond-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cond-fields { flex-direction: column; gap: 4px; margin: 6px 0 0 18px; }
.cond-fields textarea, .cond-fields input[type="number"] { max-width: 320px; }
.cond-label { font-weight: 600; }
.cond-help { color: #6b7280; font-size: 11px; }
.sc-notice-box { background: #fff; padding: 20px; box-shadow: 0 4px 8px rgba(0, 0, 0, .1); max-width: 600px; }
.sc-notice-actions { display: flex; gap: 8px; margin-top: 10px; }
.copy-fallback { position: fixed; left: -9999px; top: 0; }

/* ---- guided application wizard (app_wizard.js) ---- */
.wiz { margin: 4px 0 12px; }
.wiz-steps {
  list-style: none; margin: 0 0 10px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.wiz-chip {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px; padding: 6px 10px;
  font: inherit; font-size: 14px; line-height: 1.2;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.wiz-chip.wiz-done { color: var(--ok); border-color: var(--ok); }
.wiz-chip.wiz-todo { color: var(--warn); border-color: var(--warn); font-weight: 700; }
.wiz-chip.wiz-blocked { color: var(--muted); border-color: var(--line); background: var(--bg); }
.wiz-chip.wiz-na { color: var(--muted); opacity: .55; }
.wiz-strip { display: flex; flex-wrap: wrap; gap: 4px; }
.wiz-strip .wiz-chip { min-height: 0; padding: 2px 6px; cursor: default; border-style: dashed; }
.wiz-panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.wiz-title { margin: 0 0 4px; font-size: 16px; }
.wiz-status { margin: 0 0 10px; font-size: 14px; }
.wiz-status.wiz-done { color: var(--ok); }
.wiz-status.wiz-todo { color: var(--warn); font-weight: 600; }
.wiz-status.wiz-blocked { color: var(--muted); }
.wiz-label {
  margin: 10px 0 2px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.wiz-what { margin: 0 0 6px; font-size: 14px; }
.wiz-howto { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.wiz-howto li { margin: 2px 0; }
.wiz-more { margin: 10px 0; font-size: 14px; }
.wiz-more > summary { cursor: pointer; color: var(--accent); }
.wiz-next { margin-top: 12px; min-height: 36px; font-size: 14px; }
