/* Leasii base styles. Colours, type, spacing and radii come from tokens.css only. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 34px; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 28px; }
h3 { font-size: 18px; line-height: 24px; font-weight: 600; }

a { color: var(--brand); }
a:hover { color: var(--brand-strong); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: var(--space-2); }
.skip-link:focus { left: var(--space-2); z-index: 10; padding: var(--space-2) var(--space-4); background: var(--surface-raised); border-radius: var(--radius-md); }

.muted { color: var(--ink-muted); }
.caption { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.label { font-size: 14px; line-height: 20px; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-6); }
.stack-2xs { display: flex; flex-direction: column; gap: 2px; }
.stack-xs { display: flex; flex-direction: column; gap: var(--space-1); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }

/* App shell: mobile first. Top bar and bottom tab bar on phones; sidebar from 960px. */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.sidebar { display: none; }

.content { flex: 1 1 auto; min-width: 0; padding: var(--space-2) var(--space-4) var(--space-8); }
.content-inner { max-width: 1120px; }

.tabbar {
  position: sticky; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: var(--space-2) var(--space-1) var(--space-6);
  background: var(--surface-raised); border-top: 1px solid var(--line);
}

.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; color: var(--ink-muted); text-decoration: none;
  font-size: 13px; line-height: 16px; font-weight: 600;
}
.tab[aria-current="page"], .tab.tab-current { color: var(--brand); }
.tab[aria-disabled="true"] { opacity: .55; }
button.tab { border: 0; background: none; font-family: inherit; cursor: pointer; }
.more-menu { max-height: calc(100vh - 2 * var(--space-8)); overflow-y: auto; }

.nav { display: flex; flex-direction: column; gap: var(--space-1); }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px; border-radius: var(--radius-md);
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 600;
}
.nav-item:hover { background: var(--surface); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.nav-item[aria-disabled="true"] { color: var(--ink-muted); }
.nav-item .soon { margin-left: auto; font-size: 13px; font-weight: 400; }

@media (min-width: 960px) {
  .app { flex-direction: row; }
  .topbar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-6);
    position: sticky; top: 0; height: 100vh; flex: 0 0 248px;
    padding: var(--space-6) var(--space-4);
    background: var(--surface-raised); border-right: 1px solid var(--line);
  }
  .sidebar .brand { display: block; padding: var(--space-1) 0; }
  .sidebar .brand picture, .sidebar .brand img { display: block; width: 100%; height: auto; }
  .content { padding: var(--space-8) 40px 48px; }
  .content-inner { max-width: 1440px; }
  .card p { max-width: 72ch; }
  h1 { font-size: 40px; line-height: 44px; }
}

/* Components */

.card {
  padding: var(--space-4);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
@media (min-width: 960px) { .card { padding: 20px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  font: 600 14px/20px var(--font-sans); text-decoration: none; cursor: pointer;
}
.btn-primary { border: 0; background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.btn-secondary { border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.btn-secondary:hover { border-color: var(--brand); color: var(--ink); }
/* Danger: the confirm button for things that can't be undone (serve a notice, reverse a payment, delete). */
.btn-danger { border: 0; background: var(--critical); color: var(--surface-raised); }
.btn-danger:hover { background: color-mix(in srgb, var(--critical) 85%, var(--ink)); color: var(--surface-raised); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-key { border: 0; background: var(--key); color: var(--on-key); }
.btn-key:hover { filter: brightness(1.05); color: var(--on-key); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-raised); color: var(--ink);
}

.badge { display: inline-block; padding: 2px var(--space-2); border-radius: var(--radius-sm); font-size: 13px; line-height: 18px; font-weight: 600; }
.badge-key { background: var(--key); color: var(--on-key); }
.badge-soft { background: var(--brand-soft); color: var(--brand-strong); }
:is(.stack, .stack-sm, .stack-xs, .stack-2xs) > .badge { align-self: flex-start; }

.banner { display: flex; gap: 12px; padding: var(--space-4); border-radius: var(--radius-md); background: var(--brand-soft); color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); }
.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 34px; }

.text-good { color: var(--good); }
.text-warning { color: var(--warning); }
.text-critical { color: var(--critical); }

.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding: var(--space-6); }

/* Forms */

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; line-height: 20px; font-weight: 600; padding: 0; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--surface-raised); color: var(--ink); font: 400 16px/24px var(--font-sans);
}
.input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.input.input-validation-error { border-color: var(--critical); }
.input-sm { width: auto; min-height: 40px; padding: 8px 10px; font-size: 14px; line-height: 20px; }
.input-sm.input-fill { width: 100%; }
.field-error, .field-validation-error { color: var(--critical); font-size: 13px; line-height: 18px; }
.field-validation-valid { display: none; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: var(--space-2); }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 20px; }
.check input, .choice input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }

.choice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-2); }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-disabled { opacity: .55; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); }
.btn-block { width: 100%; }
/* Text buttons: a quieter action next to a primary one, still a 44px target. */
.btn-text { border: 0; background: none; color: var(--brand); padding: 0 var(--space-2); }
.btn-text:hover { color: var(--brand-strong); text-decoration: underline; }
.btn-text-danger { border: 0; background: none; color: var(--critical); padding: 0 var(--space-2); }
.btn-text-danger:hover { text-decoration: underline; }
.inline-form { display: inline-flex; }
.btn-link { border: 0; padding: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.alert { padding: 12px var(--space-4); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; border: 1px solid transparent; }
.content-inner > .alert { margin-bottom: var(--space-4); }
.alert ul { margin: 0; padding-left: 18px; }
.alert-error { background: color-mix(in srgb, var(--critical) 10%, var(--surface-raised)); border-color: color-mix(in srgb, var(--critical) 35%, transparent); color: var(--critical); }
.alert-success { background: var(--brand-soft); color: var(--brand-strong); }
.alert-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--ink); }
.alert-dev { background: color-mix(in srgb, var(--key) 22%, var(--surface-raised)); border-color: var(--key); color: var(--ink); overflow-wrap: anywhere; }
.validation-summary-valid { display: none; }

/* Lists and page headers */

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.narrow { max-width: 760px; }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px var(--space-4); padding: 14px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.list-main .caption { overflow-wrap: anywhere; }
.list-main .badge { margin-left: 6px; }
.list-tags { display: flex; gap: var(--space-1); }
.list-role, .list-count { color: var(--ink-muted); font-size: 14px; }
.avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 600;
}

/* App shell additions */

.topbar-actions { display: flex; gap: var(--space-2); }
.topbar-actions form { display: contents; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.sidebar-footer .avatar { width: 32px; height: 32px; font-size: 14px; }
.sidebar-user { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-muted); }

/* Sign-in pages: a brand panel beside the form on desktop, the form alone on phones.
   The panel keeps the light theme's deep green in dark mode too. */

.auth { min-height: 100vh; display: grid; --brand-deep: #0a5244; --on-brand-deep: #ffffff; }
.auth-aside { display: none; }
.auth-main { display: flex; flex-direction: column; min-height: 100vh; padding: 20px var(--space-4); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.auth-mobile-logo img { display: block; height: 28px; width: auto; }
.auth-switch { margin-left: auto; font-size: 14px; color: var(--ink-muted); }
.auth-switch a { font-weight: 600; }
.auth-panel { width: 100%; max-width: 400px; margin: auto; padding: 40px 0; display: flex; flex-direction: column; gap: var(--space-6); }
@media (min-width: 600px) {
  .auth-panel {
    max-width: 420px; margin: auto; padding: 36px 32px;
    background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised);
  }
}
.auth-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.auth-head h1, .auth-panel h1 { font-weight: 800; font-size: 32px; line-height: 38px; letter-spacing: -.01em; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-alt { color: var(--ink-muted); font-size: 15px; }
.auth-alt a { font-weight: 600; }
.auth-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--space-2); border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong); }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: var(--ink-muted); }
.auth-foot a { color: var(--ink-muted); }

.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 72px; }
.input-addon {
  position: absolute; top: 4px; right: 4px; bottom: 4px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--brand); font: 600 14px/20px var(--font-sans); cursor: pointer;
}
.input-addon:hover { background: var(--brand-soft); }

.strength { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.strength i { width: 36px; height: 4px; border-radius: 2px; background: var(--line); }
.strength span { margin-left: 6px; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--critical); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--key); }
.strength[data-level="3"] i { background: var(--good); }
.strength[data-level="1"] span { color: var(--critical); }

@media (min-width: 960px) {
  .auth { grid-template-columns: 3fr minmax(420px, 2fr); }
  .auth-main { padding: 28px 48px; }
  .auth-mobile-logo { visibility: hidden; }
  .auth-aside {
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8);
    padding: 40px 48px; color: var(--on-brand-deep);
    background:
      radial-gradient(circle at 85% 15%, rgba(242,180,65,.22), transparent 40%),
      radial-gradient(circle at 10% 90%, rgba(79,195,161,.25), transparent 45%),
      var(--brand-deep);
  }
  .auth-logo { display: block; width: 168px; height: auto; }
  .auth-aside-body { display: flex; flex-direction: column; gap: var(--space-4); }
  .auth-tagline { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 44px; letter-spacing: -.01em; max-width: 440px; }
  .auth-aside-lede { font-size: 17px; line-height: 26px; opacity: .85; max-width: 40ch; }
  .auth-cards { display: flex; flex-direction: column; gap: 12px; margin-top: var(--space-6); max-width: 380px; }
  .auth-card {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 16px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px);
  }
  .auth-card-offset { margin-left: 32px; }
  .auth-card div { display: flex; flex-direction: column; }
  .auth-card strong { font-size: 15px; }
  .auth-card span:not(.auth-card-dot) { font-size: 13px; opacity: .8; }
  .auth-card-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; }
  .auth-dot-good { background: #5fcb8c; } .auth-dot-key { background: #f2b441; } .auth-dot-soft { background: #9fe0cb; }
  .auth-points { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
  .auth-points li::before { content: "✓"; margin-right: 8px; color: #f2b441; font-weight: 700; }
}

/* Admin tables and forms */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th { padding: 8px 12px; text-align: left; font-weight: 600; color: var(--ink-muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .col-end { text-align: right; }
.table .badge { margin-left: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
@media (min-width: 720px) { .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Label and value pairs: <dl class="rule-list"><div><dt>…</dt><dd>…</dd></div></dl>, stacked on phones. */
.rule-list { display: grid; gap: var(--space-2); margin: 0; }
.rule-list > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.rule-list dt { color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.rule-list dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 600px) { .rule-list > div { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-4); } }
textarea.input { resize: vertical; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); }
.input-prefix .input { padding-left: 26px; }
.nav-admin { padding-top: var(--space-4); border-top: 1px solid var(--line); }
.nav-heading { padding: 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }

.switch input { appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #ffffff; transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.feature-switch { display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.feature-switch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.feature-switch-head .switch { flex: none; }

/* Two-step verification */
.method-choice { color: inherit; text-decoration: none; }
.method-choice:hover { border-color: var(--brand); }
.setup-steps { display: flex; flex-direction: column; gap: var(--space-6); margin: 0; padding-left: 20px; }
.setup-steps > li { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.qr-code { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #ffffff; } /* QR codes need a white background in dark mode too */
.code-inline { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .04em; overflow-wrap: anywhere; }
.input-code { max-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .2em; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; }

/* Dialogs (<dialog class="modal">) */
.modal { width: min(480px, calc(100vw - 2 * var(--space-4))); max-height: calc(100vh - 2 * var(--space-4)); padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-raised); }
.modal::backdrop { background: color-mix(in srgb, var(--ink) 45%, transparent); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
button.method-choice { width: 100%; font: inherit; color: inherit; text-align: left; }
.method-choice .caption, .modal p { overflow-wrap: anywhere; }

/* Settings */

.tabs { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--ink-muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--brand-strong); border-bottom-color: var(--brand); }
.sidebar-account { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; border-radius: var(--radius-md); }
.sidebar-account:hover .sidebar-user { color: var(--ink); }
.owner-switcher { display: flex; flex-direction: column; gap: 6px; padding: 0 12px; }
.owner-switcher .nav-heading { padding: 0; }
.owner-switcher select { width: 100%; }

/* Notifications */

.nav-secondary { padding-top: var(--space-2); }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12px; line-height: 18px; text-align: center; }
.bell { position: relative; }
.bell-count { position: absolute; top: 4px; right: 4px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--critical); color: var(--surface-raised); font-size: 10px; line-height: 16px; text-align: center; }
.notification-list .list-row { padding-inline: var(--space-2); }
.notification-list .is-unread .label { font-weight: 700; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: transparent; align-self: flex-start; margin-top: 7px; }
.dot-brand { background: var(--brand); }
.dot-critical { background: var(--critical); }

/* Inbox: emails shown as their own text, line breaks kept */
.email-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.attachment-list { margin: 0; padding: 0; list-style: none; }
.email-more summary { cursor: pointer; }
.email-more .email-text { margin-top: var(--space-2); }

/* Messages: tenancy conversations, never edited once sent */
.thread { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.message { display: flex; flex-direction: column; gap: var(--space-1); max-width: 85%; align-self: flex-start; padding: 12px var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.message-mine { align-self: flex-end; border-color: transparent; background: var(--brand-soft); }
.message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); }
.tabs .dot { display: inline-block; width: 8px; height: 8px; margin: 0 0 1px 6px; vertical-align: middle; }

/* Properties */

.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.property-card { display: flex; flex-direction: column; gap: 12px; padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; }
.property-card:hover { border-color: var(--brand); color: var(--ink); }
.property-photo { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.property-photo img { width: 100%; height: 100%; object-fit: cover; }
.property-body { padding: 0 var(--space-4) var(--space-4); }
.overview-grid { display: grid; gap: var(--space-4); }
@media (min-width: 960px) { .overview-grid { grid-template-columns: 3fr 2fr; } }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--ink-muted); font-size: 14px; }
.details dd { margin: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-left: 28px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); }
.checklist li.done::before { border-color: var(--good); background: var(--good); }
/* Onboarding checklist (OnboardingChecklist view component): six steps with a progress bar */
.onboarding-property + .onboarding-property { padding-top: var(--space-4); border-top: 1px solid var(--line); }
.onboarding-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.progress { flex: 1 1 200px; height: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-strong); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--brand); }
.progress-fill[data-done="1"] { width: calc(100% / 6); }
.progress-fill[data-done="2"] { width: calc(200% / 6); }
.progress-fill[data-done="3"] { width: 50%; }
.progress-fill[data-done="4"] { width: calc(400% / 6); }
.progress-fill[data-done="5"] { width: calc(500% / 6); }
.progress-fill[data-done="6"] { width: 100%; }
.onboarding-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.onboarding-step { display: flex; align-items: flex-start; gap: var(--space-2); }
.onboarding-step-body { flex: 1; min-width: 0; }
.onboarding-step-body > .btn { align-self: flex-start; margin-top: var(--space-1); }
.onboarding-marker { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-strong); }
.onboarding-step.is-done .onboarding-marker { border-color: var(--good); background: var(--good); }
.onboarding-step.is-progress .onboarding-marker { border-color: var(--brand); background: linear-gradient(90deg, var(--brand) 50%, transparent 50%); }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-2); }
.photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); }
.photo-strip img.floor-plan { object-fit: contain; background: var(--surface-raised); border: 1px solid var(--line); }
.photo-strip-sm { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

/* Inspection room: one card per item with one-tap Yes / No choices; cards sit side by side on wide screens. */
.room-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.room-save-status { margin: 0; }
.room-items { display: grid; gap: var(--space-4); }
@media (min-width: 960px) { .room-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .room-items { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.room-item { display: flex; flex-direction: column; gap: var(--space-4); }
.room-item-name { margin: 0; font-size: 18px; line-height: 24px; }
.room-item-ratings { display: flex; flex-direction: column; gap: var(--space-2); }
.room-item-actions, .room-add-item { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-4); }
.room-item-actions .field, .room-add-item .field { flex: 1 1 220px; }
.segmented-legend { float: left; width: 104px; margin: 0; padding-top: 12px; font-size: 14px; line-height: 20px; font-weight: 600; }
.segmented-options {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
}
.segmented-input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.segmented-option {
  display: flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: 44px; padding: 0 var(--space-4);
  background: var(--surface-raised); color: var(--ink); font: 600 14px/20px var(--font-sans); cursor: pointer;
}
.segmented-option + .segmented-input + .segmented-option { border-left: 1px solid var(--line-strong); }
.segmented-option:hover { background: var(--brand-soft); }
.segmented-input:checked + .segmented-yes { background: var(--brand); color: var(--on-brand); }
.segmented-input:checked + .segmented-no { background: var(--critical); color: var(--surface-raised); }
/* The tick means the choice doesn't rely on colour alone (WCAG 1.4.1). */
.segmented-input:checked + .segmented-option::before { content: "\2713"; }
.segmented-input:focus-visible + .segmented-option { outline: 2px solid var(--ink); outline-offset: -4px; }
.segmented:disabled .segmented-option { cursor: default; }
.segmented:disabled .segmented-input:not(:checked) + .segmented-option { color: var(--ink-muted); }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.link-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.link-list a { overflow-wrap: anywhere; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.photo-tile { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.photo-tile img, .home-card-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); }
.inline-edit { display: flex; gap: var(--space-2); }
.inline-edit .input { flex: 1; }
/* Address type-ahead (address-lookup.js); shown only once the script runs */
.address-search[hidden], .address-checked[hidden] { display: none; }
.address-checked { margin-left: var(--space-2); vertical-align: middle; }
.address-suggestions { max-height: 300px; overflow-y: auto; margin: 0; padding: var(--space-1) 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-raised); }
.address-suggestions li { padding: 10px 12px; cursor: pointer; font-size: 15px; line-height: 22px; }
.address-suggestions li:hover, .address-suggestions li[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-strong); }
.room summary { display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; list-style: none; }
.room summary::-webkit-details-marker { display: none; }
.room[open] summary { margin-bottom: var(--space-4); }
.choice-list-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice-list-compact .choice { padding: 10px 12px; align-items: center; }
/* Two choices side by side even on phones, e.g. I agree / I disagree on the signing page's comment step. */
.choice-list-pair { grid-template-columns: 1fr 1fr; }
.choice-list-pair .choice { padding: 10px 12px; align-items: center; }
.plain-list { margin: 0; padding-left: 18px; }
.badge-muted { background: var(--surface); color: var(--ink-muted); border: 1px solid var(--line); }

/* Compliance, rules and tasks */

.badge-good { background: color-mix(in srgb, var(--good) 14%, var(--surface-raised)); color: var(--good); }
.badge-warn { background: color-mix(in srgb, var(--warning) 18%, var(--surface-raised)); color: color-mix(in srgb, var(--warning) 70%, var(--ink)); }
.badge-critical { background: color-mix(in srgb, var(--critical) 12%, var(--surface-raised)); color: var(--critical); }
.item-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.item-row > :first-child { flex: 1 1 280px; min-width: 0; }
.fold > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "+ "; }
.fold[open] > summary::before { content: "− "; }
.fold[open] > summary { margin-bottom: var(--space-4); }
.rule-value { white-space: pre-line; }
.prose { max-width: 70ch; line-height: 1.6; }
.prose h2, .prose h3 { margin-top: var(--space-6); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose code { font-size: 0.9em; background: var(--surface); padding: 1px 4px; border-radius: var(--radius-sm); }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task-list > li { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.task-list > li:first-child { border-top: 0; padding-top: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* Legal holds (RUL-004) */

.badge-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.badge-link { text-decoration: none; }
.badge-link:hover { text-decoration: underline; }

/* Trade ratings (TRD-002) */

.stars { color: var(--warning); letter-spacing: 1px; white-space: nowrap; }
.stars-empty { color: var(--line-strong); }
.rating-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: var(--space-1); }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; font-size: 28px; line-height: 1; color: var(--line-strong); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--warning); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Message templates (COM-008 to COM-010) */

.template-body { min-height: 280px; line-height: 22px; }
.template-source { margin: 0; padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.template-preview { display: block; width: 100%; min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.template-placeholders { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.template-locked { margin: 0; padding-left: 18px; }
.template-published { display: block; }
.alert-warn { background: color-mix(in srgb, var(--warning) 14%, var(--surface-raised)); border-color: color-mix(in srgb, var(--warning) 40%, transparent); color: var(--ink); }

/* Electronic signing: the signer's pages, /verify and the owner's envelope pages */

.signing-shell { min-height: 100vh; display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-4); }
.signing-top, .signing-main { width: 100%; max-width: 760px; margin: 0 auto; }
.signing-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.signing-top img { display: block; height: 28px; width: auto; }
.signing-main { flex: 1; display: flex; flex-direction: column; gap: var(--space-4); }
.signing-main [hidden] { display: none; }
.signing-from { align-self: flex-start; }
/* Renter pages (apply) reuse the signing shell with their own small header. */
.renter-tagline { margin-right: auto; }
.renter-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
/* Tenant repairs: emergency help sits first. */
.emergency-card { border-left: 4px solid var(--critical); }
.signing-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); counter-reset: signing-step; }
.signing-steps li { counter-increment: signing-step; padding-top: var(--space-2); border-top: 3px solid var(--line); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.signing-steps li::before { content: counter(signing-step) ". "; font-weight: 600; }
.signing-steps li.current { border-top-color: var(--brand); color: var(--ink); font-weight: 600; }
.signing-steps li.done { border-top-color: var(--good); }
/* Signing document viewer (pdf-viewer.js): PDF.js draws each page on a canvas; page boxes are sized by the script as you zoom. */
.pdf-viewer { display: flex; flex-direction: column; gap: var(--space-2); }
.pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.pdf-toolbar[hidden], .pdf-pages[hidden], .pdf-fallback[hidden] { display: none; }
.pdf-zoom { min-width: 44px; padding-left: var(--space-2); padding-right: var(--space-2); }
.pdf-zoom-level { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.pdf-page-count { margin-left: auto; }
.pdf-pages { height: 70vh; min-height: 420px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.pdf-pages:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pdf-page { margin: 0 auto var(--space-2); background: var(--surface-raised); box-shadow: var(--shadow-raised); }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-fallback { margin: 0; padding: var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--ink-muted); }
.signature-pad { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; color: var(--ink); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
/* Typed signatures preview in the script font they're stamped in on the signed copy (Dancing Script, SIL OFL 1.1). */
@font-face { font-family: "Leasii Signature"; src: url("/lib/fonts/dancing-script/DancingScript.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
.signature-typed { margin: 0; padding: var(--space-2) var(--space-4); min-height: 56px; font-family: "Leasii Signature", var(--font-display); font-size: 34px; line-height: 44px; overflow-wrap: anywhere; border-bottom: 1px solid var(--line-strong); }
.hash { overflow-wrap: anywhere; word-break: break-all; }
.signer-list > li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.event-trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; line-height: 20px; }
.event-trail li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: var(--space-4); border-left: 2px solid var(--line); }
@media (min-width: 640px) { .event-trail li { grid-template-columns: 190px minmax(0, 1fr); gap: var(--space-4); } }
.verify-result { border-left: 4px solid var(--good); }
.verify-result.verify-missing { border-left-color: var(--critical); }

/* Proof of ownership queue (ONB-003): submissions past the 24-hour target */

.queue-overdue { padding-left: var(--space-2); border-left: 4px solid var(--critical); }

/* Identity checks (ONB-001): the return page shows the message for the check's current state */

[data-identity-state] .identity-state { display: none; }
[data-identity-state="Pending"] .identity-state[data-state="Pending"],
[data-identity-state="Verified"] .identity-state[data-state="Verified"],
[data-identity-state="InReview"] .identity-state[data-state="InReview"],
[data-identity-state="NameMismatch"] .identity-state[data-state="NameMismatch"],
[data-identity-state="Failed"] .identity-state[data-state="Failed"],
[data-identity-state="Expired"] .identity-state[data-state="Expired"] { display: flex; }
.identity-spinner { display: inline-block; flex: none; width: 16px; height: 16px; margin-right: var(--space-2); border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: identity-spin 0.9s linear infinite; vertical-align: -3px; }
@keyframes identity-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .identity-spinner { animation: none; } }

/* Staff legal holds: owners, their properties and tenancies to choose from, indented by level. */
.hold-targets, .hold-targets ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.hold-targets ul { padding-left: var(--space-6); }

/* Reading an uploaded lease (INT-011): values to check against the lease, and ones that weren't found */
.field-source { overflow-wrap: anywhere; }
.field-read-check .input { border-color: var(--warning); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 45%, transparent); }
.field-read-check .field-source { color: color-mix(in srgb, var(--warning) 70%, var(--ink)); font-weight: 600; }
.field-read-missing .input { border-style: dashed; border-color: var(--line-strong); }
.reading-spinner { display: inline-block; width: 16px; height: 16px; margin-right: var(--space-2); border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: identity-spin 0.9s linear infinite; vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .reading-spinner { animation: none; } }
.read-extras { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-2) var(--space-4); margin: 0; }
.read-extras dt { font-weight: 600; }
.read-extras dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 599px) { .read-extras { grid-template-columns: minmax(0, 1fr); } .read-extras dd { margin-bottom: var(--space-2); } }

/* Legal documents: the update banner, the Markdown editor and comparing a draft with the version in force */
.legal-update { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.legal-body { min-height: 420px; line-height: 22px; }
.legal-changes summary { cursor: pointer; font-weight: 600; }
.legal-publish { border-top: 1px solid var(--line); padding-top: var(--space-4); }
.legal-diff { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.legal-diff li { display: flex; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); line-height: 20px; overflow-wrap: anywhere; }
.legal-diff-mark { flex: none; width: 1ch; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.legal-diff-same { color: var(--ink-muted); }
.legal-diff-added { background: color-mix(in srgb, var(--good) 12%, var(--surface-raised)); }
.legal-diff-added ins { text-decoration: none; }
.legal-diff-removed { background: color-mix(in srgb, var(--critical) 10%, var(--surface-raised)); }

/* Phone top bar: logo with whose records you're working on, then at most three 44px buttons; the account menu */
.topbar-brand { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-brand > a { display: inline-flex; align-self: flex-start; }
.topbar-owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn { padding: 0; border-color: transparent; background: none; border-radius: 50%; cursor: pointer; }
.account-btn .avatar { width: 36px; height: 36px; font-size: 14px; }
.account-summary { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.account-summary .caption { overflow-wrap: anywhere; }
.account-signout { padding-top: var(--space-4); border-top: 1px solid var(--line); }
.more-menu .owner-switcher { padding: 0; }
.support-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.auth-logo-link { display: inline-flex; }

/* Forms while they send (site.js): buttons are disabled and say what's happening. */
form[aria-busy="true"] :is(button, input[type="submit"]):disabled { cursor: progress; }

/* Linked cards (e.g. the dashboard's summary) */
a.card { color: var(--ink); text-decoration: none; }
a.card:hover, a.card:focus-visible { border-color: var(--brand); color: var(--ink); }
.stat-critical { border-color: var(--critical); }
.stat-critical .stat-value { color: var(--critical); }

/* Dashboard: what needs you now, then what's coming up, in one card */
.dashboard-head { align-items: flex-end; }
.attention + .attention { padding-top: var(--space-6); border-top: 1px solid var(--line); }
.attention-amount a { font-weight: 700; color: var(--critical); }

/* Accessibility (WCAG 2.2 AA) */

/* 2.4.11: keep focused fields and links clear of the sticky marketing header and the phone tab bar when the browser scrolls to them. */
html:has(.mk-header) { scroll-padding-top: 84px; }
@media (max-width: 959px) { html:has(.tabbar) { scroll-padding-bottom: 96px; } }

/* 2.5.8: standalone caption links (e.g. "Forgot password?", "Open") are at least 24px tall. */
a.caption { padding-block: 3px; }

/* 2.3.3: people who ask for less motion get none. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
