/* One stylesheet for the owner screens and the tenant portal. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #17202e;
  --ink-2: #4a5568;
  --ink-3: #718096;
  --line: #e3e7ed;
  --line-2: #cfd6df;
  --brand: #2f6f5e;
  --brand-ink: #ffffff;
  --brand-soft: #e6f2ee;
  --good: #1f7a4d;
  --good-soft: #e3f4ea;
  --warn: #946200;
  --warn-soft: #fdf3dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --info: #2b5fb4;
  --info-soft: #e5eefb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  color: var(--ink);
  background: var(--bg);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; }
h3 { font-size: 0.95rem; margin: 0 0 8px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ---------- Owner layout ---------- */
.shell {
  display: grid; grid-template-columns: 236px 1fr; min-height: 100vh;
  background: linear-gradient(to right, #14231f 236px, var(--bg) 236px);
}
.sidebar {
  background: #14231f;
  color: #cfe0da;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; padding: 0 8px 18px; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 1rem;
}
.nav-group { margin: 0 0 14px; }
.nav-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7f9a91; padding: 0 10px 6px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; color: #cfe0da; padding: 7px 10px; border-radius: 8px;
  margin: 1px 0; font-size: 0.93rem;
}
.sidebar nav a .icon { flex: none; opacity: 0.75; }
.sidebar nav a.active .icon, .sidebar nav a:hover .icon { opacity: 1; }
.sidebar nav a.active { box-shadow: inset 3px 0 0 #6fcf9f; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; }

.main { min-width: 0; }
.topbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar form { display: flex; gap: 6px; align-items: center; margin: 0; }
.topbar label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 0.85rem; color: var(--ink-2); }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 64px; max-width: 1240px; }

/* ---------- Surfaces ---------- */
.card, form.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 0 0 16px;
}
form.card {
  max-width: 920px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 16px;
  align-items: end;
}
form.card > *:not(label), form.card > label.inline, form.card > label:has(textarea) { grid-column: 1 / -1; }
form.card > button, form.card > p > button:not(.btn-block) { justify-self: start; margin-top: 4px; }
form.card > label { margin-bottom: 14px; }
form.card > label > input:not([type="checkbox"]):not([type="radio"]), form.card > label > select { width: 100%; }
form.card .methods, form.card #dropin { grid-column: 1 / -1; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.grid > .card { margin: 0; }
.grid > .card > h2 {
  margin: 0 0 6px; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-3);
}
.grid > .card > p { margin: 4px 0; }
.grid > .card > p.num:first-of-type { font-size: 1.55rem; font-weight: 700; text-align: left; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.stat .value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 0.85rem; color: var(--ink-3); }

.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin: 0 0 18px; }
.page-head p { margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table {
  border-collapse: separate; border-spacing: 0; width: 100%; margin: 0 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.table-wrap > table { margin: 0; border: 0; box-shadow: none; border-radius: 0; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #fafbfc; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfb; }
td form { display: inline; }
.empty { color: var(--ink-3); text-align: center; padding: 22px; }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--bad); }
.pos { color: var(--good); }
.muted { color: var(--ink-3); font-size: 0.92rem; }

/* ---------- Messages ---------- */
.warning, .notice {
  background: var(--warn-soft); color: #5c4300; border: 1px solid #f3dfa8;
  padding: 10px 14px; margin: 0 0 16px; border-radius: 10px;
}
.notice { background: var(--brand-soft); color: #1d4a3e; border-color: #c6e3d9; }
.disclaimer {
  font-size: 0.88rem; color: var(--ink-2); margin: 0 0 18px; padding: 10px 14px; border-radius: 10px;
  background: #eef1f4; border: 1px solid var(--line);
}
details.disclaimer summary { cursor: pointer; }
details.disclaimer[open] summary { margin-bottom: 6px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  line-height: 1.6; white-space: nowrap; background: #eef1f4; color: var(--ink-2);
}
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 0.88rem; font-weight: 500; color: var(--ink-2); }
label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin-right: 14px; }
input, select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible {
  outline: 3px solid rgba(47, 111, 94, 0.25); outline-offset: 1px; border-color: var(--brand);
}
textarea { width: 100%; min-height: 4.5rem; }
.topbar input, .topbar select { padding: 5px 8px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  color: var(--brand-ink); background: var(--brand); border: 1px solid var(--brand);
  border-radius: 8px; padding: 8px 14px; text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn-ghost, td button, .topbar button {
  background: #fff; color: var(--ink); border-color: var(--line-2);
}
.btn-ghost:hover, td button:hover, .topbar button:hover { background: #f4f6f8; filter: none; }
.btn-lg { padding: 12px 20px; font-size: 1rem; border-radius: 10px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Charts ---------- */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 160px; margin: 6px 0 4px; }
.bar-col { display: flex; gap: 3px; align-items: flex-end; height: 100%; justify-content: center; }
.bar { width: 40%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.in { background: var(--brand); }
.bar.out { background: #e0a43a; }
.bar-labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; text-align: center; font-size: 0.75rem; color: var(--ink-3); }
.legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.split > * { min-width: 0; }
.meter { height: 8px; background: #eef1f4; border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: #e0a43a; }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 10px; font-size: 0.9rem; }
.cat-row .meter { grid-column: 1 / -1; }

/* ---------- Sign-in and tenant portal ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 10% -10%, #d8ebe4 0, transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 28px; }
.auth-card .brand { color: var(--ink); justify-content: center; padding: 0 0 18px; font-size: 1.2rem; }
.auth-card h1 { text-align: center; font-size: 1.4rem; }
.auth-card .lead { text-align: center; color: var(--ink-2); margin: 0 0 20px; }
.auth-card input { width: 100%; }
.auth-foot { text-align: center; margin-top: 14px; font-size: 0.88rem; color: var(--ink-3); }

.portal-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-top .inner { max-width: 880px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.portal-top .brand { color: var(--ink); padding: 0; }
.portal-top nav { display: flex; gap: 4px; flex: 1; }
.portal-top nav a { color: var(--ink-2); white-space: nowrap; padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.portal-top nav a.active, .portal-top nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.portal-main { max-width: 880px; margin: 0 auto; padding: 26px 20px 64px; }

.hero {
  background: linear-gradient(135deg, #2f6f5e, #24584b); color: #fff; border-radius: 16px;
  padding: 26px 28px; margin: 0 0 18px; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
}
.hero .label { opacity: 0.85; font-size: 0.9rem; }
.hero .amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero .sub { opacity: 0.85; font-size: 0.92rem; }
.hero .btn { background: #fff; color: var(--brand); border-color: #fff; }
.hero.clear { background: linear-gradient(135deg, #3a7d6a, #2f6f5e); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .what { font-weight: 600; }
.list .when { font-size: 0.85rem; color: var(--ink-3); }

.methods { display: grid; gap: 10px; margin: 0 0 14px; }
.method {
  display: flex; flex-direction: row; align-items: center; gap: 12px; margin: 0; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; color: var(--ink);
}
.method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.method .grow { flex: 1; }
.method .total { font-weight: 700; font-variant-numeric: tabular-nums; }
.method small { display: block; color: var(--ink-3); font-weight: 400; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; font-weight: 500; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .sidebar nav a { white-space: nowrap; }
  .brand { padding-bottom: 10px; }
  .topbar { position: static; padding: 10px 16px; justify-content: flex-start; }
  .content { padding: 18px 16px 48px; }
  .split { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .hero .amount { font-size: 2rem; }
  .portal-top .inner { flex-wrap: wrap; }
}

/* ---------- Team ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  font-weight: 700; font-size: 0.9rem; color: #fff; background: #64748b;
}
.avatar-manager { background: #2f6f5e; } .avatar-leasing { background: #2b5fb4; }
.avatar-scheduler { background: #7c3aed; } .avatar-service { background: #c2410c; }
.avatar-ap { background: #b45309; } .avatar-ar { background: #0f766e; }
.avatar-compliance { background: #9f1239; } .avatar-controller { background: #334155; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-grid > .card { margin: 0; }
.role-card { color: var(--ink); display: block; }
.role-card:hover { text-decoration: none; border-color: var(--brand); }
.role-head { display: flex; gap: 12px; align-items: flex-start; }
.role-head > div { flex: 1; }
.role-head .muted { font-size: 0.82rem; }
.role-metrics { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.role-findings { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.88rem; }
.role-findings li { padding: 4px 0 4px 14px; position: relative; }
.role-findings li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.role-findings li.lvl-act::before { background: #e0a43a; }
.role-findings li.lvl-ok::before { background: var(--good); }
.msg { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.msg .grow { flex: 1; min-width: 0; }
.msg p { margin: 4px 0; }
.msg-subject { font-weight: 600; margin-top: 2px; }
.msg-rec { background: var(--brand-soft); padding: 6px 10px; border-radius: 8px; font-size: 0.9rem; }
.feed-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.feed-row .avatar { width: 28px; height: 28px; font-size: 0.8rem; }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; max-height: 460px; overflow-y: auto; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; font-size: 0.93rem; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: #eef1f4; border-bottom-left-radius: 4px; }
.composer { display: flex; gap: 8px; }
.composer input { flex: 1; }

/* ---------- Contracts ---------- */
.sign-banner { display: flex; align-items: center; gap: 14px; color: var(--ink); border-color: #c6e3d9; background: var(--brand-soft); }
.sign-banner:hover { text-decoration: none; border-color: var(--brand); }
.sign-banner .grow { flex: 1; }
.sign-icon { font-size: 1.6rem; }
.terms { width: 100%; border: 0; box-shadow: none; margin: 0 0 14px; }
.terms th { width: 40%; background: none; text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 500; }
.terms td { font-weight: 600; }
.signature { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 1.7rem; color: #1d3a8a; }
.seal { border: 1px dashed var(--line-2); border-radius: 10px; padding: 14px 16px; background: #fbfcfd; }

/* ---------- Characters ---------- */
.avatar-svg { flex: none; border-radius: 50%; display: block; }
.avatar-you { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: #475569; color: #fff; font-size: 0.72rem; font-weight: 700; }
.agent-name { font-size: 1.05rem; }
.agent-title { font-size: 0.82rem; font-weight: 600; color: var(--ink-3); }
h1 .agent-title { font-size: 1rem; margin-left: 4px; }
.tagline { font-style: italic; color: var(--ink-2); margin: 2px 0 4px; }
.role-card .role-head { align-items: center; }
.role-hero { align-items: center; gap: 18px; }
.proposal-who { display: flex; gap: 10px; align-items: flex-start; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; max-width: 85%; }
.bubble-row .bubble { max-width: none; }
.msg-head .muted { margin-left: 4px; }

/* ---------- Refinements ---------- */
body { -webkit-font-smoothing: antialiased; }
h1 { font-weight: 800; letter-spacing: -0.02em; }
.page-head h1 { margin-bottom: 4px; }
.stats-6 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (min-width: 1180px) { .stats-6 { grid-template-columns: repeat(6, 1fr); } }
.stat { min-height: 112px; }
.stat .value small { font-size: 0.95rem; font-weight: 600; color: var(--ink-3); }
.stat .sub a { font-weight: 600; }
.card { transition: border-color .15s, box-shadow .15s; }
a.card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08); }
.table-wrap td:first-child { min-width: 150px; }
td .muted { font-size: 0.85rem; }
summary { cursor: pointer; }
details.card > summary { list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "+"; font-weight: 700; color: var(--brand); width: 1em; }
details.card[open] > summary::before { content: "–"; }

/* Team cards: avatar and status on one line, name and title stacked, motto underneath. */
.role-card { display: flex; flex-direction: column; gap: 10px; }
.role-card .role-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.role-card .role-head > div { min-width: 0; }
.role-card .agent-name { display: block; line-height: 1.2; }
.role-card .agent-title { display: block; font-size: 0.8rem; }
.role-card .tagline { display: none; }
.role-card .motto { font-size: 0.88rem; font-style: italic; color: var(--ink-2); margin: 0; }
.role-card .role-metrics { margin: 0; padding: 8px 10px; background: #f6f8f9; border-radius: 8px; }
.role-card .role-findings { margin: 0; }
.role-findings a { color: var(--ink); }
.role-findings a:hover { color: var(--brand); }
.role-hero .avatar-svg { box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12); }
.role-page-stats { grid-template-columns: repeat(auto-fill, minmax(160px, 220px)); }
.role-page-stats .stat { min-height: 0; }
details.card .stack { margin-top: 14px; }
details.card .stack > form.card { box-shadow: none; background: #fafbfc; }
/* Tenant forms stay one field per row: simpler on a phone. */
.portal-main form.card { display: block; max-width: none; }
.portal-main form.card > label:not(.inline) { max-width: none; }
.portal-main form.card > label > input:not([type="checkbox"]) { width: 100%; }
@media (max-width: 640px) {
  .portal-top .inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .portal-top .inner > form { margin-left: auto; }
  .portal-top .inner > form button { padding: 6px 12px; }
  .portal-top nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .portal-top nav a { flex: 1; text-align: center; }
}

/* ---------- Sign-in with the 3D neighborhood ---------- */
.auth-split {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); padding: 0; gap: 0;
  min-height: 100vh; place-items: stretch; background: var(--bg);
}
.auth-split .auth-card { align-self: center; justify-self: center; width: 100%; max-width: 420px; padding: 32px 24px; }
.auth-split .auth-card .card { box-shadow: 0 10px 40px rgba(16, 24, 40, 0.08); }
.scene {
  position: relative; overflow: hidden; min-height: 100vh;
  background: linear-gradient(180deg, #bfe0f2 0%, #e4f0ee 55%, #f6ecdc 100%);
}
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.scene.ready canvas { opacity: 1; }
.scene-fallback { position: absolute; left: 50%; top: 46%; width: min(80%, 520px); transform: translate(-50%, -50%); transition: opacity .6s; }
.scene.ready .scene-fallback { opacity: 0; }
.scene-caption {
  position: absolute; left: 40px; bottom: 36px; right: 40px; max-width: 440px; color: #12302a;
  animation: rise .9s ease both .2s;
}
.scene-kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #2f6f5e; }
.scene-caption h2 { font-size: 2.4rem; line-height: 1.05; letter-spacing: -0.03em; margin: 6px 0 8px; font-weight: 800; }
.scene-caption p { margin: 0; font-size: 1.02rem; color: #2e4a43; }
.auth-split .auth-card { animation: rise .7s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .auth-split .auth-card, .scene-caption { animation: none; }
  .scene canvas, .scene-fallback { transition: none; }
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .scene { min-height: 0; height: 40vh; max-height: 340px; }
  .scene-caption { display: none; }
  .auth-split .auth-card { align-self: start; margin-top: -28px; padding: 0 16px 32px; position: relative; z-index: 1; }
  .auth-split .auth-card > .brand { display: none; }
}

/* Site name with a small label under it. */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-size: 0.68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .65; margin-top: 2px; }
.sidebar .brand { font-size: 0.98rem; }
.portal-top .brand { font-size: 1rem; }

/* ---------- Lease page ---------- */
.h1-badge { vertical-align: middle; margin-left: 6px; }
.h1-badge .badge { font-size: 0.8rem; }
.facts-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.facts-row .stat { min-height: 0; }
.small-value { font-size: 1.05rem !important; line-height: 1.35; padding: 4px 0; }
.lease-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.lease-side .card h2, .lease-main .card h2 { margin-top: 0; }
.lease-side .list li { padding: 9px 0; }
.notes p { font-size: 0.88rem; color: var(--ink-2); margin: 0 0 8px; }
.callout { border-color: #c6e3d9; background: var(--brand-soft); }
.inner-form { box-shadow: none; background: #fafbfc; margin: 10px 0 0; }
.table-wrap.flat { border: 0; box-shadow: none; margin: 0; }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.upload-form input[type=file] { flex: 1; min-width: 0; font-size: 0.85rem; padding: 6px; }
details.history { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.history summary { color: var(--ink-2); font-weight: 600; font-size: 0.9rem; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 4px 0 16px; counter-reset: step; }
.steps li { position: relative; padding: 30px 4px 0; text-align: center; font-size: 0.8rem; color: var(--ink-3); font-weight: 600; }
.steps li::before {
  counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem;
  background: #eef1f4; color: var(--ink-3); border: 2px solid #eef1f4; z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #e3e7ed; }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--good); }
.steps li.done::before { content: "✓"; background: var(--good); border-color: var(--good); color: #fff; }
.steps li.done::after, .steps li.current::after { background: var(--good); }
.steps li.current { color: var(--ink); }
.steps li.current::before { background: #fff; border-color: var(--brand); color: var(--brand); }
@media (max-width: 1100px) { .lease-layout { grid-template-columns: 1fr; } }

/* ---------- Lists you click through ---------- */
table.rows-link tbody tr { cursor: pointer; }
table.rows-link tbody tr:hover td { background: #f3f8f6; }
.chev { color: var(--ink-3); font-size: 1.3rem; line-height: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; max-width: none; }
.toolbar label.inline { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 0.88rem; }
.chip span { color: var(--ink-3); font-weight: 500; }
.chip:hover { text-decoration: none; border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on span { color: #d8efe6; }
.pay-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.year-total { font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
form.card.toolbar { display: flex; max-width: none; }
form.card.toolbar > * { grid-column: auto; margin: 0; }
form.card.toolbar select, form.card.toolbar input { width: auto; }

/* ---------- Bank payment form ---------- */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.bank-grid input, .bank-grid select { width: 100%; }
.mandate { font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); background: #f6f8f9; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; }
.breakdown td { text-align: right; font-weight: 600; }
.breakdown .total-row th, .breakdown .total-row td { font-size: 1.1rem; font-weight: 800; color: var(--ink); border-top: 2px solid var(--line-2); }
.pay-steps { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 0.92rem; }
.pay-steps li { margin: 4px 0; }
.split-table td { font-weight: 500; }
.split-table .total-row td { font-weight: 800; }
.utility-bill:target { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,94,.15); }

/* Which copy of the app this is (APP_LABEL), so the demo is never mistaken for the real one. */
.env-ribbon { position: sticky; top: 0; z-index: 50; background: #7c3aed; color: #fff; text-align: center; font-size: 0.82rem; font-weight: 700; letter-spacing: .04em; padding: 5px 12px; }
.social { display: grid; gap: 10px; }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.btn-social:hover { background: #f8fafc; color: var(--ink); }
/* Public policy pages */
.legal-page { background: var(--bg); }
.legal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 0 auto; padding: 24px 16px 0; }
.legal-head .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.legal-mark { width: 32px; height: 32px; border-radius: 8px; }
.legal-head nav { display: flex; gap: 16px; font-size: 0.9rem; }
.legal { max-width: 760px; margin: 24px auto; padding: 32px clamp(20px, 5vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); line-height: 1.65; }
.legal h1 { margin-top: 0; }
.legal h2 { margin-top: 1.8em; font-size: 1.1rem; }
.legal li { margin: 0.35em 0; }
.legal-foot { max-width: 760px; margin: 0 auto 40px; padding: 0 16px; color: var(--ink-3); font-size: 0.85rem; text-align: center; }
/* Welcome packet */
.steps-list { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps-list li { counter-increment: step; }
.step-link { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.step-link:hover { border-color: var(--brand); background: var(--brand-soft); }
.step-link::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid h3 { margin: 14px 0 4px; font-size: 0.95rem; color: var(--ink-2); }
.req { color: var(--bad); }
table.inspection select, table.inspection input { width: 100%; min-width: 140px; margin: 0; }
table.inspection th[scope="row"] { white-space: nowrap; }
.terms-section { padding-top: 14px; color: var(--ink-2); }
