/* Renter site shell: floating glass bar, left drawer sheet, Back pill, footer. No bottom bar or picker anywhere. */
.mark-bg { fill: var(--ink); }
.mark-roof { stroke: var(--accent); }
.mark-walls { stroke: var(--surface); }
html:not([data-top]) .site-bar-wrap, html:not([data-top]) .page, html:not([data-top]) .site-footer, html:not([data-top]) .drawer { visibility: hidden; }
.frame-notice { max-width: 480px; margin: 20vh auto; padding: 24px; text-align: center; display: grid; gap: 12px; font-size: var(--text-lead); }
.frame-notice a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: var(--r-pill); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* Floating top bar. Content scrolls beneath it, so the glass has something to show. */
.site-bar-wrap { position: sticky; top: 0; z-index: 40; padding: max(var(--bar-gap), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); pointer-events: none; }
.site-bar { pointer-events: auto; max-width: var(--page-max); margin: 0 auto; height: var(--bar-h); display: flex; align-items: center; gap: 16px; padding: 0 10px 0 14px; border-radius: var(--r-pill); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; border-radius: var(--r-pill); }
.brand .mark { flex: none; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.bar-nav { display: flex; align-items: center; gap: 4px; padding: 2px; margin-left: 8px; border-radius: var(--r-pill); background: var(--tint); }
.bar-nav a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 18px; border-radius: var(--r-pill); font-size: var(--text-small); font-weight: 600; color: var(--ink-2); transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.bar-nav a:hover { color: var(--ink); }
.bar-nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-ctl); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-pill); font-size: var(--text-small); font-weight: 600; color: var(--ink-2); }
.bar-link .ico { width: 17px; height: 17px; }
.bar-link:hover { color: var(--ink); background: var(--tint); }
.account-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 3px 14px 3px 3px; border-radius: var(--r-pill); background: var(--tint); border: 1px solid var(--line); font-size: var(--text-small); font-weight: 650; transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.account-chip:hover { background: var(--surface); }
.account-chip:active { transform: scale(.97); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 700; flex: none; }
.avatar .ico { width: 18px; height: 18px; }
.menu-button { display: none; margin-left: -4px; }

/* Drawer: a floating sheet from the left. Hidden from focus when closed. */
.drawer { position: fixed; z-index: 60; top: max(10px, env(safe-area-inset-top)); bottom: 10px; left: max(10px, env(safe-area-inset-left)); width: min(calc(100vw - 20px), 340px); display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-photo); background: var(--glass-strong); overflow-y: auto; overscroll-behavior: contain; transform: translateX(calc(-100% - 24px)); visibility: hidden; transition: transform 320ms var(--ease-move), visibility 0s linear 320ms; }
body.drawer-open .drawer { transform: none; visibility: visible; transition: transform 320ms var(--ease-move), visibility 0s; }
body.drawer-open { overflow: hidden; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px 6px; }
.drawer-user { display: flex; align-items: center; gap: 12px; margin: 2px 0 4px; padding: 10px 12px; border-radius: var(--r-sheet); background: var(--surface); box-shadow: var(--shadow-sheet); }
.drawer-user div { display: grid; gap: 1px; min-width: 0; }
.drawer-user strong { font-size: 15px; overflow-wrap: anywhere; }
.drawer-user small { color: var(--ink-3); }
.drawer-avatar-guest { background: var(--surface-3); color: var(--ink-2); }
.drawer-nav { display: grid; gap: 1px; padding: 2px 0; }
.drawer-caption { font-size: var(--text-meta); font-weight: 650; color: var(--ink-3); padding: 12px 10px 4px; }
.drawer-nav a, .drawer-link { display: flex; align-items: center; gap: 12px; min-height: var(--tap-lg); padding: 0 8px; border-radius: var(--r-ctl); font-size: 17px; font-weight: 600; color: var(--ink); width: 100%; text-align: left; transition: background-color var(--dur-fast) var(--ease-out); }
.drawer-nav a:hover, .drawer-link:hover { background: var(--tint); }
.drawer-nav a:active, .drawer-link:active { background: var(--tint-2); }
.drawer-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--tint); color: var(--ink-2); flex: none; }
.drawer-ico .ico { width: 19px; height: 19px; }
.drawer-nav a.active { background: var(--surface); box-shadow: 0 1px 2px var(--tint), 0 4px 14px var(--tint); }
.drawer-nav a.active .drawer-ico { background: var(--accent-soft); color: var(--accent-ink); }
.drawer-nav .nav-label { flex: 1; min-width: 0; }
/* Records folds into one native disclosure in the drawer: a 56px summary with the section names as its state line. */
.nav-fold { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.nav-fold summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px 6px 10px; border-radius: var(--r-ctl); cursor: pointer; list-style: none; }
.nav-fold summary::-webkit-details-marker { display: none; }
.nav-fold summary:hover { background: var(--tint); }
.nav-fold-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.nav-fold-title { font-size: 17px; font-weight: 650; }
.nav-fold-hint { font-size: var(--text-meta); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-fold-chev { width: 20px; height: 20px; color: var(--ink-3); transition: transform var(--dur) var(--ease-out); }
.nav-fold[open] .nav-fold-chev { transform: rotate(180deg); }
.nav-fold-body { display: grid; gap: 1px; padding: 2px 0 4px; }
.drawer-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: var(--overlay); animation: fade-in var(--dur) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Page frame and the explicit Back pill. */
.page { max-width: var(--page-max); margin: 0 auto; padding: 28px max(var(--gutter), env(safe-area-inset-right)) 72px max(var(--gutter), env(safe-area-inset-left)); min-height: 70vh; box-sizing: content-box; }
.route-return { margin-bottom: 16px; }
.back-pill { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 18px 0 10px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-sheet); font-size: var(--text-small); font-weight: 650; color: var(--ink); max-width: 100%; transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.back-pill:hover { background: var(--surface-2); }
.back-pill:active { transform: scale(.97); }
.back-pill .ico { width: 20px; height: 20px; color: var(--ink-2); }
.back-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-main:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: var(--r-sheet); }
.loading-line { color: var(--ink-3); padding: 24px 0; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer-inner { max-width: var(--page-max); margin: 0 auto; padding: 28px max(var(--gutter), env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; justify-content: space-between; box-sizing: content-box; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand span { display: grid; gap: 1px; }
.foot-brand small { color: var(--ink-3); }
.site-footer .meta { max-width: 48ch; }

@media (max-width: 900px) {
  .site-bar { gap: 6px; padding: 0 8px 0 6px; }
  .menu-button { display: inline-grid; margin-left: 0; }
  .bar-nav, .bar-sign-out, .account-chip-name { display: none; }
  .portal-btn { min-height: var(--tap); padding: 0 14px; font-size: 15px; gap: 6px; }
  .portal-btn .ico { display: none; }
  .account-chip { padding: 3px; min-height: var(--tap); background: transparent; border-color: transparent; }
  .brand-name { font-size: 15.5px; }
  .page { padding-top: 16px; padding-bottom: 56px; }
  .route-return { margin-bottom: 14px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 901px) {
  .drawer, .backdrop { display: none; }
}
/* Public welcome site on a phone: the Resident and Landlord buttons are the whole menu, so the drawer button steps
   aside, and on narrow phones the mark alone carries the brand so both buttons fit. */
/* The public site is one page: no Homes pill beside the brand. */
body.site-public .bar-nav { display: none; }
@media (max-width: 900px) {
  body.site-public .menu-button { display: none; }
  body.site-public .site-bar { padding-left: 10px; }
}
@media (max-width: 420px) {
  body.site-public .brand-name { display: none; }
}
