:root {
    color: #101828;
    background: #f6f8fc;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-brand: #eef2ff;
    --text: #101828;
    --text-subtle: #344054;
    --muted: #667085;
    --muted-strong: #475467;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;
    --brand: #4f46e5;
    --brand-hover: #4338ca;
    --brand-soft: #eef2ff;
    --success: #067647;
    --success-soft: #ecfdf3;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --info: #175cd3;
    --info-soft: #eff8ff;
    --sidebar: #101828;
    --sidebar-soft: #1d2939;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 12px 30px rgba(16, 24, 40, .12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --scrollbar-size: 8px;
    --scrollbar-track: color-mix(in srgb, var(--surface-soft) 72%, transparent);
    --scrollbar-thumb: color-mix(in srgb, var(--brand) 42%, var(--border-strong));
    --scrollbar-thumb-hover: color-mix(in srgb, var(--brand) 68%, var(--border-strong));
    --scrollbar-thumb-active: var(--brand);
}

* { box-sizing: border-box; }

/*
 * One native scrollbar treatment for every document and nested scroll region.
 * Firefox keeps its accessible native thin scrollbar; Chromium/WebKit receives
 * the equivalent compact geometry with a theme/accent-aware, usable thumb.
 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    min-width: 32px;
    min-height: 32px;
    background-color: var(--scrollbar-thumb);
    background-clip: padding-box;
    border: 2px solid var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-thumb:active { background-color: var(--scrollbar-thumb-active); }
*::-webkit-scrollbar-corner { background: var(--scrollbar-track); }

@media (forced-colors: active) {
    * { scrollbar-color: auto; }
}

html {
    min-width: 320px;
    min-height: 100%;
    scrollbar-gutter: stable;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body.modal-open,
body.nav-open { overflow: hidden; }

button,
input,
select { font: inherit; }

button { cursor: pointer; }

button,
input,
select {
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease,
        color 150ms ease, opacity 150ms ease, transform 150ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .28);
    outline-offset: 2px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .62;
}

::selection {
    color: var(--text);
    background: #c7d2fe;
}

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    color: #fff;
    background: var(--brand);
    border-radius: var(--radius-sm);
    transform: translateY(-140%);
}

.skip-link:focus { transform: translateY(0); }

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }

.skeleton {
    display: block;
    overflow: hidden;
    position: relative;
    background: #e9edf5;
    border-radius: 8px;
}

.skeleton::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.55s infinite;
}

.app-boot {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
}

.boot-side {
    padding: 25px 20px;
    background: var(--sidebar);
}

.boot-brand { display: flex; align-items: center; gap: 11px; }
.skeleton-logo { width: 38px; height: 38px; background: #344054; }
.skeleton-brand { width: 126px; height: 18px; background: #344054; }
.boot-nav { display: grid; gap: 12px; margin-top: 52px; }
.boot-nav .skeleton { width: 100%; height: 42px; background: #1d2939; }
.boot-main { min-width: 0; }
.boot-top {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.boot-top .skeleton:first-child { width: 180px; height: 18px; }
.boot-top .skeleton:last-child { width: min(420px, 42vw); height: 40px; }
.boot-content { padding: 38px 40px; }
.boot-title { width: 320px; max-width: 70%; height: 34px; }
.boot-subtitle { width: 420px; max-width: 86%; height: 15px; margin-top: 14px; }
.boot-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 34px;
}
.boot-cards .skeleton { height: 152px; }

.login {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(460px, 1.06fr) minmax(420px, .94fr);
    background: #fff;
}

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: clamp(32px, 5vw, 72px);
    color: #fff;
    background:
        radial-gradient(circle at 78% 22%, rgba(99,102,241,.48), transparent 30%),
        radial-gradient(circle at 22% 86%, rgba(16,185,129,.18), transparent 32%),
        linear-gradient(145deg, #0b1220 8%, #111b31 56%, #172554);
}

.hero::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: inherit;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.02em;
}

.brand-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(79,70,229,.28);
}

.hero-content {
    width: min(610px, 100%);
    margin: auto 0;
    padding: 72px 0;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    padding: 7px 11px;
    color: #dbeafe;
    font-size: 12px;
    font-weight: 650;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
}

.hero h1 {
    max-width: 610px;
    margin: 0;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.04;
    letter-spacing: -.055em;
}

.hero-copy {
    max-width: 550px;
    margin: 25px 0 0;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.65;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 34px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
}

.hero-point { display: inline-flex; align-items: center; gap: 8px; }
.hero-point .icon { color: #6ee7b7; }
.hero-foot { color: #94a3b8; font-size: 12px; }

.login-panel {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 48px clamp(32px, 8vw, 112px);
    background: #fff;
}

.login form { width: min(420px, 100%); }
.auth-brand-mobile { display: none; color: var(--text); margin-bottom: 42px; }
.login h2 {
    margin: 0;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -.035em;
}
.login-intro { margin: 10px 0 30px; color: var(--muted); line-height: 1.55; }
.login label,
.modal label {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    color: var(--text-subtle);
    font-size: 13px;
    font-weight: 650;
}

input,
select,
textarea {
    min-height: 42px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
}

input:hover,
select:hover,
textarea:hover { border-color: #98a2b3; }

input:focus,
select:focus,
textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99,102,241,.1);
    outline: none;
}

.login input,
.modal input,
.modal select,
.modal textarea { width: 100%; padding: 11px 12px; }
.modal textarea { min-height: 92px; line-height: 1.5; resize: vertical; }
.login .primary { width: 100%; min-height: 44px; margin-top: 24px; }
.auth-footnote { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.password-signout {
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    color: var(--muted-strong);
    background: transparent;
    border-color: var(--border);
}
.password-change .login-intro { margin-bottom: 22px; }

.auth-onboarding .login-panel {
    place-items: start center;
    align-content: center;
    overflow-y: auto;
    padding: 42px clamp(28px, 5vw, 76px);
}

.login .auth-form {
    width: min(600px, 100%);
    padding-block: 28px;
}

.auth-form form { width: 100%; }

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.auth-form-grid .auth-span-two { grid-column: 1 / -1; }

.auth-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.auth-progress li {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--border);
}

.auth-progress li[aria-current="step"] {
    color: var(--brand);
    border-color: var(--brand);
}

.auth-progress li.complete {
    color: var(--success);
    border-color: #6ce9a6;
}

.auth-progress li > span {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    color: inherit;
    background: var(--surface-soft);
    border: 1px solid currentColor;
    border-radius: 50%;
}

.auth-progress .icon { width: 13px; height: 13px; }

.login .auth-form select,
.login .auth-form input {
    width: 100%;
    padding: 11px 12px;
}

.login .auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
    margin-top: 20px;
    color: var(--muted-strong);
    font-weight: 500;
    line-height: 1.45;
}

.login .auth-check input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    accent-color: var(--brand);
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.auth-switch a {
    color: var(--brand);
    font-weight: 700;
    text-underline-offset: 3px;
}

.auth-error:not(:empty) { margin: 0 0 8px; }

p.field-help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.login .otp-input {
    font-size: 25px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: .42em;
    text-align: center;
}

.auth-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
}

.auth-text-button {
    min-height: 32px;
    padding: 5px 7px;
    color: var(--brand);
    font-weight: 700;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.auth-text-button:hover { background: var(--brand-soft); }
.auth-live-status { min-height: 18px; margin: 5px 0 0; color: var(--success); text-align: center; }

.auth-loading,
.auth-state {
    padding: 24px;
    color: var(--muted-strong);
    text-align: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #c7d2fe;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-state .primary { width: 100%; margin-top: 12px; }

.invitation-access-pending { text-align: left; }
.invitation-pending-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: var(--success);
    background: var(--success-soft);
    border-radius: 50%;
}
.invitation-pending-mark .icon { width: 24px; height: 24px; }
.invitation-pending-eyebrow {
    margin: 0 0 5px;
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.invitation-access-pending h2 { margin: 0 0 8px; color: var(--text); font-size: 22px; }
.invitation-access-pending > p:not(.invitation-pending-eyebrow) { margin: 0; line-height: 1.55; }
.invitation-pending-next {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    color: var(--muted-strong);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.invitation-pending-next > .icon { color: var(--brand); }
.invitation-pending-next strong { display: block; color: var(--text); }
.invitation-pending-next p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }

.invitation-summary {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 22px;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.invitation-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 10px;
}

.invitation-summary p { margin: 0; }
.invitation-workspace { color: var(--text); font-size: 16px; font-weight: 750; }
.invitation-role {
    display: inline-flex;
    margin-top: 7px;
    padding: 3px 8px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 750;
    background: var(--brand-soft);
    border-radius: 999px;
}
.invitation-summary .invitation-expiry {
    grid-column: 2;
    color: var(--muted);
    font-size: 11px;
}

.login .auth-form input[readonly] {
    color: var(--muted-strong);
    background: var(--surface-soft);
}

.error {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #fecdca;
    border-radius: var(--radius-sm);
    padding: 11px 12px;
}

#err:not(:empty) { margin-bottom: 4px; }

.app {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    transition: grid-template-columns 180ms ease;
}

.side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 264px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    color: #cbd5e1;
    background: var(--sidebar);
    border-right: 1px solid rgba(255,255,255,.05);
    transition: width 180ms ease, padding 180ms ease,
        transform 190ms cubic-bezier(.2,.75,.25,1);
}

.side > .brand { padding: 0 8px 22px; color: #fff; }
.side-close { display: none; }
.side nav {
    --scrollbar-track: color-mix(in srgb, var(--sidebar) 88%, transparent);
    --scrollbar-thumb: color-mix(in srgb, var(--brand) 44%, var(--sidebar-soft));
    --scrollbar-thumb-hover: color-mix(in srgb, var(--brand) 68%, var(--sidebar-soft));
    --scrollbar-thumb-active: color-mix(in srgb, var(--brand) 84%, var(--sidebar-soft));
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 10px 0 18px;
}

.nav-label {
    margin: 16px 12px 7px;
    color: #667085;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nav-section {
    display: grid;
    gap: 3px;
}

.side nav .nav-section-toggle {
    min-height: 32px;
    margin-top: 12px;
    padding: 6px 10px;
    color: #667085;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-radius: 7px;
}
.nav-section-icon { width: 16px; height: 16px; flex: 0 0 auto; }

.nav-section:first-child > .nav-section-toggle { margin-top: 0; }
.side nav .nav-section-toggle:hover { color: #cbd5e1; }
.nav-section.contains-active > .nav-section-toggle {
    color: #c7d2fe;
    box-shadow: inset 2px 0 0 rgba(129,140,248,.72);
}

.nav-section-chevron {
    width: 15px;
    height: 15px;
    margin-left: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.nav-section-toggle[aria-expanded='true'] .nav-section-chevron {
    transform: rotate(90deg);
}

.nav-section-items {
    display: grid;
    gap: 3px;
}

.nav-section-items[hidden] { display: none; }

.side nav button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    color: #aeb8c8;
    font-weight: 560;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
}

.side nav button:hover { color: #fff; background: rgba(255,255,255,.055); }
.side nav button.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(79,70,229,.34), rgba(79,70,229,.18));
    border-color: rgba(129,140,248,.2);
    box-shadow: inset 3px 0 0 #818cf8;
}
.side nav button .icon { color: #8492a6; }
.side nav button.active .icon { color: #a5b4fc; }

.account {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 13px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius);
}

.account-profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #e0e7ff;
    font-size: 12px;
    font-weight: 750;
    background: #3730a3;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
}
.account-copy { min-width: 0; }
.account strong,
.account small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account strong { color: #f8fafc; font-size: 13px; }
.account small { margin-top: 3px; color: #98a2b3; font-size: 10px; text-transform: uppercase; }
.logout {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 7px 8px;
    color: #aeb8c8;
    background: transparent;
    border: 0;
    border-radius: 7px;
}
.logout:hover { color: #fff; background: rgba(255,255,255,.06); }
.account-help { text-decoration: none; }
.top-icon { text-decoration: none; }

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
    visibility: hidden;
    opacity: 0;
    background: rgba(16,24,40,.54);
    backdrop-filter: blur(2px);
    transition: opacity 180ms ease, visibility 180ms ease;
}

.body {
    min-width: 0;
    grid-column: 2;
}

.top {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.top-leading { min-width: 190px; display: flex; align-items: center; gap: 11px; }
.mobile-menu { display: none; }
.workspace-meta { min-width: 0; }
.workspace-label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.workspace {
    display: block;
    max-width: 240px;
    overflow: hidden;
    color: var(--text-subtle);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-search {
    position: relative;
    width: min(460px, 42vw);
    margin: 0 auto;
}
.top-search .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}
.top-search input {
    width: 100%;
    padding: 9px 56px 9px 38px;
    background: var(--surface-soft);
    border-color: var(--border);
}
.search-hint {
    position: absolute;
    top: 50%;
    right: 9px;
    padding: 3px 6px;
    color: var(--muted);
    font-size: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 5px;
    pointer-events: none;
    transform: translateY(-50%);
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.mode-switch button {
    min-width: 62px;
    min-height: 32px;
    padding: 5px 11px;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 700;
    background: transparent;
    border: 0;
    border-radius: 7px;
}
.mode-switch button:hover:not(:disabled) { color: var(--brand); background: var(--brand-soft); }
.mode-switch button[aria-pressed='true'] {
    color: var(--brand-strong);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(16,24,40,.12);
}
.mode-switch button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.mode-switch button:disabled { cursor: default; opacity: 1; }
.mode-switch[aria-busy='true'] { opacity: .68; }
.top-icon,
.mobile-menu,
.side-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--muted-strong);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.top-icon:hover,
.mobile-menu:hover { color: var(--brand); background: var(--brand-soft); border-color: #c7d2fe; }
.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #f04438;
    border: 1.5px solid #fff;
    border-radius: 50%;
}
.top-icon.has-indicator { position: relative; }
.mobile-menu,
.side-close { display: none; }

.tss-card-shell .app { grid-template-columns: minmax(0, 1fr); }
.tss-card-shell .body {
    grid-column: 1;
    background:
        radial-gradient(circle at 12% 4%,
            color-mix(in srgb, var(--brand-soft) 72%, transparent) 0,
            transparent 34rem),
        var(--bg);
}
.tss-card-shell .top-leading { min-width: 230px; }
.tss-app-menu .icon { width: 20px; height: 20px; }

.tss-card-navigation {
    width: 100%;
    min-height: calc(100dvh - 72px);
    padding: 34px clamp(24px, 4vw, 56px) 48px;
}
.tss-card-navigation[hidden],
.tss-content-navigation[hidden] { display: none; }

.tss-card-navigation-inner {
    width: min(100%, 840px);
    margin: 0 auto;
}

.tss-card-navigation-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.tss-card-navigation-heading-copy { min-width: 0; }
.tss-card-navigation-heading-copy p {
    margin: 0 0 7px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.tss-card-navigation-heading-copy h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(25px, 2.4vw, 32px);
    line-height: 1.18;
}
.tss-card-navigation-heading-copy > span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}
.tss-card-navigation-heading-copy > span i {
    width: 3px;
    height: 3px;
    display: inline-block;
    margin: 0 7px 2px;
    background: currentColor;
    border-radius: 50%;
}
.tss-card-close {
    min-width: 76px;
    min-height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    color: var(--muted-strong);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
    font-size: 11px;
    font-weight: 700;
}
.tss-card-close:hover {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 26%, var(--border));
}

.tss-content-navigation {
    width: min(100%, 1440px);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto -14px;
    padding: 20px 40px 0;
}
.tss-back-to-apps {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    color: var(--brand);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
    border-radius: 11px;
    box-shadow: var(--shadow-xs);
    font-size: 11px;
    font-weight: 750;
}
.tss-back-to-apps:hover {
    color: var(--brand-hover);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
    box-shadow: var(--shadow-sm);
    transform: translateX(-1px);
}
.tss-current-destination {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}
.tss-current-destination small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.tss-current-destination strong {
    overflow: hidden;
    color: var(--text-subtle);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tss-card-sections { display: grid; gap: 28px; }
.tss-card-section {
    --tss-card-accent: var(--brand);
    min-width: 0;
}
.tss-card-section[data-tss-card-section='requests'],
.tss-card-section[data-tss-card-section='workflows'],
.tss-card-section[data-tss-card-section='operations'] {
    --tss-card-accent: var(--info);
}
.tss-card-section[data-tss-card-section='services'],
.tss-card-section[data-tss-card-section='data-management'] {
    --tss-card-accent: var(--success);
}
.tss-card-section > summary {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 4px 2px;
    color: var(--muted-strong);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    list-style: none;
    text-transform: uppercase;
    cursor: pointer;
}
.tss-card-section > summary > span:first-child {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tss-card-section > summary > span:first-child::after {
    height: 1px;
    flex: 1;
    content: '';
    background: color-mix(in srgb, var(--border) 86%, transparent);
}
.tss-card-section > summary::-webkit-details-marker { display: none; }
.tss-card-section > summary::marker { content: ''; }
.tss-card-section > summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
    outline-offset: 2px;
    border-radius: 8px;
}
.tss-card-section-control {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-xs);
}
.tss-card-section-control svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}
.tss-card-section[open] .tss-card-section-control svg { transform: rotate(180deg); }
.tss-card-section.contains-active > summary { color: var(--brand); }

.tss-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.tss-card-grid > button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 0;
    min-height: 122px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 13px;
    padding: 18px 12px;
    color: var(--text-subtle);
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--surface) 78%, var(--surface-soft)),
        color-mix(in srgb, var(--surface-soft) 86%, var(--tss-card-accent)));
    border: 1px solid color-mix(in srgb, var(--tss-card-accent) 10%, var(--border));
    border-radius: 20px;
    box-shadow: var(--shadow-xs), 0 8px 22px rgba(16, 24, 40, .055);
    text-align: center;
}
.tss-card-grid > button::before {
    position: absolute;
    inset: 0 22% auto;
    z-index: -1;
    height: 3px;
    content: '';
    background: var(--tss-card-accent);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transform: scaleX(.4);
    transition: opacity 160ms ease, transform 160ms ease;
}
.tss-card-grid > button .icon {
    width: 44px;
    height: 44px;
    padding: 10px;
    color: var(--tss-card-accent);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--tss-card-accent) 12%, var(--border));
    border-radius: 13px;
    box-shadow: var(--shadow-xs);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.tss-card-grid > button span {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}
@media (hover: hover) and (pointer: fine) {
    .tss-card-grid > button:hover {
        color: var(--tss-card-accent);
        border-color: color-mix(in srgb, var(--tss-card-accent) 34%, var(--border));
        box-shadow: var(--shadow-sm), 0 14px 30px rgba(16, 24, 40, .09);
        transform: translateY(-3px);
    }
    .tss-card-grid > button:hover .icon {
        border-color: color-mix(in srgb, var(--tss-card-accent) 30%, var(--border));
        box-shadow: 0 5px 12px rgba(16, 24, 40, .09);
        transform: translateY(-1px);
    }
}
.tss-card-grid > button:active { transform: translateY(0) scale(.985); }
.tss-card-grid > button.active {
    color: var(--tss-card-accent);
    background: linear-gradient(145deg, var(--surface),
        color-mix(in srgb, var(--surface-soft) 78%, var(--tss-card-accent)));
    border-color: color-mix(in srgb, var(--tss-card-accent) 44%, var(--border));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tss-card-accent) 12%, transparent),
        var(--shadow-xs);
}
.tss-card-grid > button.active::before {
    opacity: 1;
    transform: scaleX(1);
}

.tss-card-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.tss-card-account-profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tss-card-account-profile > span:last-child { min-width: 0; }
.tss-card-account-profile strong,
.tss-card-account-profile small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tss-card-account-profile strong { color: var(--text-subtle); font-size: 12px; }
.tss-card-account-profile small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}
.tss-card-account-actions { display: flex; align-items: center; gap: 8px; }
.tss-card-account-actions a,
.tss-card-account-actions button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 11px;
    color: var(--muted-strong);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}
.tss-card-account-actions a:hover,
.tss-card-account-actions button:hover {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 25%, var(--border));
}

@media (min-width: 1041px) {
    .mobile-menu { display: inline-grid; }
    .sidebar-compact .app { grid-template-columns: 76px minmax(0, 1fr); }
    .sidebar-compact .side { width: 76px; padding-inline: 10px; }
    .sidebar-compact .side > .brand {
        justify-content: center;
        padding-inline: 0;
    }
    .sidebar-compact .side > .brand span,
    .sidebar-compact .nav-section-toggle > span,
    .sidebar-compact .nav-section-items button > span,
    .sidebar-compact .account-copy,
    .sidebar-compact .logout > span { display: none; }
    .sidebar-compact .side nav { overflow-x: hidden; }
    .sidebar-compact .side nav button {
        justify-content: center;
        gap: 0;
        padding-inline: 8px;
    }
    .sidebar-compact .side nav .nav-section-toggle {
        min-height: 38px;
        margin-top: 8px;
        color: #98a2b3;
    }
    .sidebar-compact .nav-section-chevron { display: none; }
    .sidebar-compact .account { padding: 8px 7px; }
    .sidebar-compact .account-profile { justify-content: center; }
    .sidebar-compact .logout { justify-content: center; padding-inline: 0; }
}

@keyframes shimmer { to { transform: translateX(100%); } }

.primary,
.secondary,
.tertiary,
.danger-primary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    font-weight: 650;
    border-radius: var(--radius-sm);
}

.primary {
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    box-shadow: var(--shadow-xs);
}
.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); box-shadow: 0 2px 5px rgba(79,70,229,.24); }
.primary:active,
.secondary:active,
.tertiary:active { transform: translateY(1px); }

.secondary {
    color: var(--text-subtle);
    background: #fff;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-xs);
}
.secondary:hover { color: var(--text); background: var(--surface-soft); border-color: #98a2b3; }

.tertiary {
    color: var(--brand);
    background: transparent;
    border: 1px solid transparent;
}
.tertiary:hover { background: var(--brand-soft); }

.danger-primary {
    color: #fff;
    background: var(--danger);
    border: 1px solid var(--danger);
}
.danger-primary:hover { background: #912018; }

.content {
    width: 100%;
    min-width: 0;
    max-width: 1560px;
    min-height: calc(100dvh - 72px);
    margin: 0 auto;
    padding: 36px clamp(24px, 3vw, 48px) 52px;
}

.view {
    animation: view-in 180ms cubic-bezier(.2,.75,.25,1) both;
}

.heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.heading-copy { min-width: 0; }
.eyebrow {
    margin: 0 0 7px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.heading h1 {
    margin: 0;
    font-size: clamp(27px, 2.2vw, 34px);
    line-height: 1.18;
    letter-spacing: -.035em;
}
.heading-copy > p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}
.heading-actions { display: flex; align-items: center; gap: 9px; }

.card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.kpi {
    min-height: 148px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-label { color: var(--muted-strong); font-size: 12px; font-weight: 650; }
.kpi-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 9px;
}
.kpi-icon.success { color: var(--success); background: var(--success-soft); }
.kpi-icon.warning { color: var(--warning); background: var(--warning-soft); }
.kpi-icon.info { color: var(--info); background: var(--info-soft); }
.kpi-value {
    display: block;
    margin-top: 18px;
    font-size: 29px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: -.04em;
}
.kpi-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 11px;
}
.kpi-meta .positive { color: var(--success); font-weight: 700; }
.kpi-meta .attention { color: var(--warning); font-weight: 700; }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
    gap: 16px;
    margin-top: 16px;
}

.dashboard-card { padding: 22px; }
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}
.card-head h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.card-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.period-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    color: var(--muted-strong);
    font-size: 10px;
    font-weight: 650;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.collection-value-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}
.collection-value { font-size: clamp(30px, 4vw, 42px); font-weight: 760; letter-spacing: -.05em; }
.collection-value small { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.collection-rate { color: var(--success); font-size: 13px; font-weight: 750; }
.progress-track {
    height: 10px;
    overflow: hidden;
    margin-top: 22px;
    background: #eef1f6;
    border-radius: 999px;
}
.progress-fill {
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    border-radius: inherit;
    transform-origin: left;
    animation: progress-in 550ms cubic-bezier(.2,.8,.2,1) both;
}
.collection-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.legend-item span { display: block; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.legend-item strong { display: block; margin-top: 6px; font-size: 14px; }

.health-list { display: grid; gap: 4px; }
.health-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--border);
}
.health-row:first-child { padding-top: 0; border-top: 0; }
.health-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--muted-strong);
    background: var(--surface-soft);
    border-radius: 9px;
}
.health-copy { min-width: 0; flex: 1; }
.health-copy strong { display: block; font-size: 12px; }
.health-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.health-number { font-weight: 750; }
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
}
.quick-link {
    min-height: 70px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    padding: 9px 6px;
    color: var(--muted-strong);
    font-size: 10px;
    font-weight: 650;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
}
.quick-link:hover { color: var(--brand); background: var(--brand-soft); border-color: #c7d2fe; }

.data-surface { overflow: hidden; }
.toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.toolbar-search {
    flex: 1 1 280px;
    width: min(440px, 100%);
    margin-right: auto;
}
.toolbar-field {
    min-width: 150px;
    display: grid;
    gap: 6px;
    margin: 0;
}
.toolbar-label {
    color: var(--muted-strong);
    font-size: 10px;
    font-weight: 700;
}
.toolbar-input { position: relative; display: block; }
.toolbar-input .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}
.toolbar-search input { width: 100%; padding: 9px 12px 9px 38px; background: var(--surface-soft); }
.toolbar select { min-width: 150px; padding: 8px 34px 8px 11px; color: var(--text-subtle); background-color: #fff; }
.toolbar input[type='date'] {
    min-width: 142px;
    min-height: 42px;
    padding: 8px 10px;
    color: var(--text-subtle);
    background: #fff;
}
.toolbar .secondary { min-height: 42px; white-space: nowrap; }
.toolbar .date-reset { align-self: end; }
.rent-ledger-toolbar .toolbar-search {
    flex: 1 1 200px;
    width: min(300px, 100%);
    margin-right: 0;
}
.rent-ledger-toolbar .toolbar-lease {
    min-width: 220px;
    flex: 1 1 240px;
    width: min(340px, 100%);
}
.rent-ledger-toolbar .toolbar-lease input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    background: var(--surface-soft);
}

.table-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 44px;
    padding: 9px 17px;
    color: var(--muted);
    font-size: 11px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
}
.table-summary strong { color: var(--text-subtle); font-weight: 650; }
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}
.table table {
    width: 100%;
    min-width: 830px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}
.table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 16px;
    color: var(--muted-strong);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .045em;
    text-align: left;
    text-transform: uppercase;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.table td {
    height: 62px;
    padding: 11px 16px;
    color: var(--text-subtle);
    font-size: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #eef1f5;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 120ms ease; }
.table tbody tr:hover,
.table tbody tr:focus-within { background: #fafbff; }
.table td strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table .name-col { width: 22%; }
.table .secondary-col { width: 15%; }
.table .status-col { width: 13%; }
.table .detail-col { width: 24%; }
.table .amount-col { width: 15%; }
.table .action-heading,
.table .action-cell {
    position: sticky;
    right: 0;
    width: 98px;
    text-align: right;
    background: #fff;
    box-shadow: -10px 0 14px -14px rgba(16,24,40,.5);
}
.table tbody tr:hover .action-cell,
.table tbody tr:focus-within .action-cell { background: #fafbff; }

.row-actions { display: inline-flex; justify-content: flex-end; gap: 6px; }
.rent-lease-context {
    min-width: 0;
    display: grid;
    gap: 3px;
    margin-top: 5px;
    line-height: 1.35;
}
.rent-lease-location {
    display: block;
    overflow: hidden;
    color: var(--text-subtle);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rent-lease-id {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 550;
}
.managed-actions {
    position: relative;
    z-index: 2;
    display: inline-flex;
    justify-content: flex-end;
    gap: 6px;
    border-radius: 8px;
}
.app .rent-ledger-surface .managed-actions .icon-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
}
.managed-actions .icon-button:disabled {
    color: var(--muted);
    background: var(--surface-soft);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: .5;
}
.managed-actions::after {
    position: absolute;
    top: 50%;
    right: calc(100% + 8px);
    z-index: 5;
    width: max-content;
    max-width: 210px;
    padding: 7px 9px;
    content: attr(data-tooltip);
    color: #fff;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    visibility: hidden;
    background: var(--sidebar);
    border-radius: 7px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translate(4px, -50%);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}
.managed-actions:hover::after,
.managed-actions:focus::after,
.managed-actions:focus-visible::after {
    visibility: visible;
    opacity: 1;
    transform: translate(0, -50%);
}
.record-detail-primary { display: block; }
.lease-row-parking {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 7px;
    color: var(--text-subtle);
}
.lease-row-parking > svg {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--brand);
}
.lease-row-parking > span { min-width: 0; }
.lease-row-parking strong,
.lease-row-parking small { display: block; }
.lease-row-parking strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lease-row-parking small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.lease-row-parking-empty { color: var(--muted); font-size: 9px; }
.lease-row-renewal {
    width: fit-content;
    display: block;
    margin-top: 6px;
    padding: 3px 6px;
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
    border-radius: 999px;
    font-size: 8px;
    font-weight: 700;
}
.lease-renew-action { color: var(--brand); background: var(--brand-soft); }
.icon-button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--muted-strong);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.icon-button:hover { color: var(--brand); background: var(--brand-soft); border-color: #c7d2fe; }
.icon-button.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: #fecdca; }
.button-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 8px;
    color: var(--muted-strong);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
    background: #f2f4f7;
    border: 1px solid #eaecf0;
    border-radius: 999px;
}
.pill::before { width: 5px; height: 5px; flex: 0 0 auto; content: ""; background: currentColor; border-radius: 50%; }
.pill.success { color: var(--success); background: var(--success-soft); border-color: #abefc6; }
.pill.warning { color: var(--warning); background: var(--warning-soft); border-color: #fedf89; }
.pill.danger { color: var(--danger); background: var(--danger-soft); border-color: #fecdca; }
.pill.info { color: var(--info); background: var(--info-soft); border-color: #b2ddff; }

.empty {
    min-height: 360px;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 48px 24px;
    color: var(--muted);
    text-align: center;
}
.empty-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 12px;
}
.empty strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 15px; }
.empty span { display: block; max-width: 360px; line-height: 1.5; }

.loading-view { min-height: calc(100dvh - 150px); }
.loading-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.loading-heading-copy { display: grid; gap: 10px; }
.loading-heading-copy .skeleton:first-child { width: 120px; height: 11px; }
.loading-heading-copy .skeleton:nth-child(2) { width: 270px; height: 34px; }
.loading-heading-copy .skeleton:last-child { width: 360px; max-width: 70vw; height: 14px; }
.loading-action { width: 140px; height: 42px; }
.loading-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.loading-cards .skeleton { height: 148px; }
.loading-table { height: 420px; margin-top: 16px; }
.route-error {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 40px;
    text-align: center;
}
.route-error .error-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--danger); background: var(--danger-soft); border-radius: 12px; }
.route-error h2 { margin: 4px 0 0; font-size: 18px; }
.route-error p { max-width: 460px; margin: 0 0 8px; color: var(--muted); line-height: 1.5; }

.reports {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.report {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}
.report-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 10px;
}
.report-copy { min-width: 0; flex: 1; }
.report h3 { margin: 0; font-size: 14px; }
.report p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.report .secondary { flex: 0 0 auto; }
.report-export-card { display: grid; align-items: stretch; gap: 14px; }
.report-summary { display: flex; align-items: center; gap: 14px; }
.report-options { padding-top: 12px; border-top: 1px solid var(--border); }
.report-options summary {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}
.report-options summary::-webkit-details-marker { display: none; }
.report-options summary::after { content: '+'; margin-left: auto; font-size: 16px; }
.report-options[open] summary::after { content: '\2212'; }
.report-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.report-option-grid input,
.report-option-grid select { width: 100%; min-width: 0; min-height: 40px; }
.report-option-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.modal-back {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16,24,40,.58);
    backdrop-filter: blur(4px);
    animation: fade-in 150ms ease both;
}
.modal {
    width: min(500px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(16,24,40,.24);
    animation: modal-in 180ms cubic-bezier(.2,.8,.2,1) both;
}
.modal.modal-wide { width: min(820px, 100%); }
.modal.modal-building { width: min(900px, 100%); }
.modal.modal-lease { width: min(940px, 100%); }
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 17px;
    border-bottom: 1px solid var(--border);
}
.modal-title-wrap { display: flex; gap: 12px; }
.modal-title-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; }
.modal h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.modal-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 8px; }
.modal-close:hover { color: var(--text); background: var(--surface-soft); }
.modal-body { padding: 2px 24px 22px; }
.modal.modal-resource-editor {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}
.modal-resource-editor .modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.resource-record-form {
    min-height: 100%;
    align-content: start;
}
.resource-record-form .modal-actions {
    position: sticky;
    bottom: -22px;
    z-index: 2;
}
.cheque-payment-lock {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 2px;
    padding: 11px 13px;
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border));
    border-radius: 10px;
}
.cheque-payment-lock > .icon { flex: 0 0 auto; margin-top: 1px; }
.cheque-payment-lock > span { min-width: 0; display: grid; gap: 3px; }
.cheque-payment-lock strong { color: var(--text-subtle); font-size: 11px; }
.cheque-payment-lock small {
    color: var(--muted-strong);
    font-size: 10px;
    line-height: 1.45;
}

.security-pass-modal { width: min(480px, calc(100vw - 28px)); }
.security-pass-modal .modal-title-icon.valid { color: var(--success); background: var(--success-soft); }
.security-pass-modal .modal-title-icon.invalid { color: var(--danger); background: var(--danger-soft); }
.security-pass-state {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
}
.security-pass-state.valid { color: var(--success); background: var(--success-soft); }
.security-pass-state.invalid { color: var(--danger); background: var(--danger-soft); }
.security-pass-state > .icon { width: 24px; height: 24px; }
.security-pass-state strong,
.security-pass-state span { display: block; }
.security-pass-state strong { font-size: 12px; }
.security-pass-state span { margin-top: 3px; font-size: 9px; text-transform: capitalize; }
.security-pass-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 14px 0 0;
    overflow: hidden;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.security-pass-details div { min-width: 0; padding: 10px 11px; background: var(--surface); }
.security-pass-details dt { color: var(--muted); font-size: 8px; font-weight: 700; }
.security-pass-details dd { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 10px; font-weight: 650; }

@media (max-width: 520px) {
    .security-pass-details { grid-template-columns: 1fr; }
}
.modal form { display: grid; }
.form-section {
    min-width: 0;
    margin: 0;
    padding: 18px 0 20px;
    border: 0;
    border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: 0; }
.form-section legend {
    width: 100%;
    padding: 0;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.lease-form-section { padding: 0; }
.lease-form-section > summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    padding: 14px 44px 14px 2px;
    color: var(--text-subtle);
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 760;
}
.lease-form-section > summary::-webkit-details-marker { display: none; }
.lease-form-section > summary::after {
    content: '+';
    position: absolute;
    right: 2px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border-strong));
    border-radius: 7px;
    font-size: 18px;
    font-weight: 650;
    line-height: 1;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.lease-form-section[open] > summary::after { content: '\2212'; }
.lease-form-section > summary:hover::after {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand-soft) 72%, var(--surface));
    border-color: color-mix(in srgb, var(--brand) 52%, var(--border-strong));
}
.lease-form-section > summary small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-align: right;
}
.lease-form-section > summary:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 7px;
}
.lease-form-section > summary:focus-visible::after,
.form-section-collapsible > summary:focus-visible::after {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
}
.lease-section-body { padding: 0 2px 20px; }
.lease-parking-picker {
    min-width: 0;
    display: grid;
    gap: 12px;
}
.lease-parking-policy {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    color: var(--text-subtle);
    background: var(--brand-soft);
    border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
    border-radius: 9px;
}
.lease-parking-policy strong,
.lease-parking-policy span { min-width: 0; }
.lease-parking-policy strong { font-size: 11px; }
.lease-parking-policy span { color: var(--muted-strong); font-size: 10px; text-align: right; }
.lease-parking-search {
    position: relative;
    display: block !important;
    margin: 0 !important;
}
.lease-parking-search > svg {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}
.lease-parking-search input { padding-left: 38px !important; }
.lease-parking-options {
    min-height: 78px;
    max-height: 260px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.lease-parking-options:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.lease-parking-option {
    min-width: 0;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px !important;
    margin: 0 !important;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.lease-parking-option:last-child { border-bottom: 0; }
.lease-parking-option:hover { background: var(--surface-soft); }
.lease-parking-option input {
    width: 18px !important;
    min-height: 18px !important;
    height: 18px;
    margin: 0;
}
.lease-parking-option span { min-width: 0; }
.lease-parking-option strong,
.lease-parking-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lease-parking-option strong { color: var(--text); font-size: 11px; }
.lease-parking-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.lease-parking-option em {
    color: var(--text-subtle);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    text-align: right;
}
.lease-parking-option input:disabled ~ * { opacity: .55; }
.lease-parking-empty {
    margin: 0;
    padding: 22px 16px;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}
.lease-parking-financials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.lease-parking-financials > div {
    min-width: 0;
    padding: 11px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
}
.lease-parking-financials span,
.lease-parking-financials strong,
.lease-parking-financials small { display: block; }
.lease-parking-financials span { color: var(--muted); font-size: 9px; }
.lease-parking-financials strong { margin-top: 4px; color: var(--text); font-size: 13px; }
.lease-parking-financials small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.lease-parking-financials .lease-parking-total {
    color: var(--brand-strong);
    background: color-mix(in srgb, var(--brand-soft) 72%, var(--surface));
    border-color: color-mix(in srgb, var(--brand) 24%, var(--border));
}
.lease-parking-financials .lease-parking-no-charge {
    grid-column: 1 / -1;
    padding-block: 14px;
    background: var(--surface);
    border-style: dashed;
}
.lease-parking-no-charge strong { font-size: 12px; }
.modal-lease-lifecycle { width: min(620px, 100%); }
.lease-lifecycle-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 16px;
    overflow: hidden;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.lease-lifecycle-summary > div { min-width: 0; padding: 12px; background: var(--surface); }
.lease-lifecycle-summary span,
.lease-lifecycle-summary strong { display: block; }
.lease-lifecycle-summary span { color: var(--muted); font-size: 9px; font-weight: 650; }
.lease-lifecycle-summary strong {
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 11px;
}
.lease-lifecycle-lock {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 14px;
    padding: 11px 12px;
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid color-mix(in srgb, var(--success) 26%, var(--border));
    border-radius: 9px;
}
.lease-lifecycle-lock > svg { flex: 0 0 auto; margin-top: 1px; }
.lease-lifecycle-lock span { display: grid; gap: 3px; }
.lease-lifecycle-lock strong { color: var(--text-subtle); font-size: 10px; }
.lease-lifecycle-lock small { color: var(--muted-strong); font-size: 9px; line-height: 1.4; }
.modal-lease-lifecycle form { gap: 2px; margin-top: 4px; }
.modal-lease-lifecycle form > label { margin-top: 14px; }
/* Force lifecycle actions require an explicit preview and acknowledgement. */
.modal .force-lifecycle-panel { min-width: 0; margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.modal .force-lifecycle-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; }
.modal .force-lifecycle-check input { flex: 0 0 auto; width: 20px; height: 20px; min-height: 20px; margin: 1px 0 0; }
.modal .force-lifecycle-check span { min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.modal .force-lifecycle-panel [hidden],
.modal-lease-lifecycle [data-lifecycle-submit][hidden] { display: none !important; }
.force-lifecycle-panel [data-force-details] { display: grid; gap: 12px; margin-top: 12px; }
.force-lifecycle-panel [data-force-details] > label { margin: 0; }
.force-lifecycle-warning { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.force-lifecycle-panel .delete-impact-group { margin-block: 10px; }
.force-lifecycle-panel .delete-impact-group ul { margin-bottom: 0; padding-left: 20px; overflow-wrap: anywhere; }
.force-lifecycle-panel [data-force-preview] { justify-self: start; }
.force-lifecycle-actions { display: flex; justify-content: flex-end; }
.force-lifecycle-panel :is(button, input, textarea) { max-width: 100%; }
@media (max-width: 640px) {
    .modal .force-lifecycle-panel { padding: 12px; }
    .force-lifecycle-panel button { min-height: 44px; }
    .force-lifecycle-actions button { width: 100%; }
}

@media (max-width: 520px) {
    .lease-lifecycle-summary { grid-template-columns: 1fr; }
}
.lease-draft-review {
    display: grid;
    gap: 14px;
    margin: 14px 0 18px;
    padding: 16px;
    background: linear-gradient(145deg, var(--surface-soft), #fff);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}
.lease-standard-toggle {
    display: flex !important;
    align-items: flex-start;
    gap: 11px;
    margin: 0 !important;
    cursor: pointer;
}
.lease-standard-toggle input,
.lease-action-confirmation input {
    appearance: none;
    display: grid;
    place-content: center;
    width: 18px;
    min-height: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 1px;
    padding: 0;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
}
.lease-standard-toggle input::before,
.lease-action-confirmation input::before {
    width: 9px;
    height: 5px;
    content: '';
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: translateY(-1px) rotate(-45deg) scale(0);
    transition: transform 120ms ease;
}
.lease-standard-toggle input:checked,
.lease-action-confirmation input:checked {
    background: var(--brand);
    border-color: var(--brand);
}
.lease-standard-toggle input:checked::before,
.lease-action-confirmation input:checked::before {
    transform: translateY(-1px) rotate(-45deg) scale(1);
}
.lease-standard-toggle span { display: grid; gap: 4px; }
.lease-standard-toggle strong { color: var(--text); font-size: 12px; }
.lease-standard-toggle small,
.lease-draft-status small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.lease-draft-status {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
}
.lease-draft-status strong { font-size: 11px; }
.modal label.lease-action-confirmation {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0 auto 0 0;
    padding: 8px 10px;
    color: var(--muted-strong);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.modal label.lease-action-confirmation[hidden] { display: none; }
.form-section-collapsible { padding: 0; }
.form-section-collapsible summary {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 44px 0 2px;
    color: var(--muted-strong);
    cursor: pointer;
    list-style: none;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.form-section-collapsible summary::-webkit-details-marker { display: none; }
.form-section-collapsible summary::after {
    content: '+';
    position: absolute;
    right: 2px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border-strong));
    border-radius: 7px;
    font-size: 18px;
    font-weight: 650;
    line-height: 1;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.form-section-collapsible[open] summary::after { content: '\2212'; }
.form-section-collapsible summary:hover::after {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand-soft) 72%, var(--surface));
    border-color: color-mix(in srgb, var(--brand) 52%, var(--border-strong));
}
.form-section-collapsible summary:focus-visible {
    z-index: 1;
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 7px;
}
.form-section-collapsible summary small {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 550;
    letter-spacing: 0;
    text-transform: none;
}
.form-section-collapsible[open] > .form-grid { padding-bottom: 20px; }
.resource-form-section,
.resource-form-section:last-of-type {
    margin: 12px 0 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.resource-form-section > summary {
    position: relative;
    min-height: 60px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 16px;
    padding: 13px 56px 13px 16px;
    color: var(--text-subtle);
    background: var(--surface-soft);
    cursor: pointer;
    list-style: none;
    border-radius: calc(var(--radius) - 1px);
    transition: background-color 140ms ease, color 140ms ease;
}
.resource-form-section > summary::-webkit-details-marker { display: none; }
.resource-form-section > summary::after {
    right: 14px;
}
.resource-form-section > summary:hover {
    color: var(--brand-strong);
    background: color-mix(in srgb, var(--brand-soft) 42%, var(--surface-soft));
}
.resource-form-section > summary:focus-visible {
    z-index: 1;
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: calc(var(--radius) - 1px);
}
.resource-form-section > summary > span {
    min-width: 0;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .01em;
}
.resource-form-section > summary small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
}
.resource-form-section[open] {
    border-color: color-mix(in srgb, var(--brand) 24%, var(--border-strong));
    box-shadow: 0 5px 16px rgba(16,24,40,.06);
}
.resource-form-section[open] > summary {
    color: var(--brand-strong);
    background: color-mix(in srgb, var(--brand-soft) 32%, var(--surface));
    border-bottom: 1px solid var(--border);
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.resource-form-section[open] > summary::after {
    content: '\2212';
}
.resource-form-section > .form-section-body {
    min-width: 0;
    padding: 2px 16px 18px;
}
.resource-form-section > .form-section-body input,
.resource-form-section > .form-section-body select,
.resource-form-section > .form-section-body textarea { scroll-margin-block: 92px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.modal .form-grid label { min-width: 0; margin-top: 14px; }
[data-field-help-field] { min-width: 0; }
.form-field[data-field-help-field] {
    display: grid;
    gap: 8px;
}
.modal .form-grid > .form-field { margin-top: 14px; }
.modal .form-field {
    color: var(--text-subtle);
    font-size: 13px;
    font-weight: 650;
}
.form-field-full { grid-column: 1 / -1; }
.modal-building .form-grid {
    gap: 16px 18px;
    margin-top: 14px;
}
.modal-building .form-grid > label,
.modal-building .form-grid > .form-field,
.modal-building .amenity-picker { margin-top: 0; }
.modal-building .form-grid > * {
    align-self: start;
    align-content: start;
}
.modal-building input:not([type='checkbox']),
.modal-building select { min-height: 44px; }
.modal-building .resource-form-section .form-grid { margin-top: 0; }
.modal-building .resource-form-section > .form-section-body { padding-top: 16px; }
.field-label-row {
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
}
.modal .field-label-row > label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}
.field-label { display: inline-flex; align-items: center; gap: 4px; }
.required-mark { color: var(--danger); }
.field-help {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: 1;
}
.field-help-trigger {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--muted-strong);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    box-shadow: none;
}
.app .field-help-trigger,
.modal-back .field-help-trigger {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
}
.field-help-trigger .icon { width: 14px; height: 14px; }
.field-help-trigger:hover,
.field-help-trigger:focus-visible,
.field-help-trigger[aria-expanded='true'] {
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 55%, var(--border-strong));
}
.field-help-layer {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}
.field-help-tooltip {
    position: fixed;
    z-index: 1;
    width: max-content;
    max-width: min(280px, calc(100vw - 24px));
    padding: 8px 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 550;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    background: #101828;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(16,24,40,.24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms step-end;
}
.field-help-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 120ms ease, transform 120ms ease, visibility 0ms step-start;
}
.field-help-tooltip.is-measuring { transition: none; }
.form-hint {
    color: var(--muted);
    font-size: 10px;
    font-weight: 450;
    line-height: 1.45;
}
.amenity-picker {
    min-width: 0;
    margin-top: 14px;
    display: grid;
    gap: 8px;
}
.amenity-combobox { min-width: 0; display: grid; gap: 7px; }
.amenity-options {
    max-height: 214px;
    overflow-y: auto;
    display: grid;
    gap: 3px;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.amenity-options[hidden] { display: none; }
.amenity-options [role='option'] {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    color: var(--text-subtle);
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
}
.amenity-options [role='option']:hover,
.amenity-options [role='option']:focus-visible {
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 18%, var(--border));
}
.amenity-options [role='option'].selected {
    color: var(--brand-strong);
    background: var(--brand-soft);
}
.amenity-options [role='option'] > span { min-width: 0; display: grid; gap: 2px; }
.amenity-options [role='option'] strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.amenity-options [role='option'] small { color: var(--muted); font-size: 9px; }
.amenity-option-check { flex: 0 0 auto; visibility: hidden; color: var(--brand); }
.amenity-options [role='option'].selected .amenity-option-check { visibility: visible; }
.amenity-no-results { margin: 0; padding: 12px 10px; color: var(--muted); font-size: 10px; }
.inventory-picker {
    min-width: 0;
    margin-top: 14px;
    display: grid;
    gap: 10px;
}
.inventory-add {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(130px, .7fr) minmax(82px, .35fr) auto;
    align-items: end;
    gap: 10px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.inventory-options {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    max-height: 214px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    display: grid;
    gap: 3px;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.inventory-options[hidden],
.inventory-options [role='option'][hidden] { display: none; }
.inventory-options [role='option'] {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    color: var(--text-subtle);
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
}
.inventory-options [role='option']:hover,
.inventory-options [role='option']:focus-visible,
.inventory-options [role='option'].selected {
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 18%, var(--border));
}
.inventory-options [role='option'] > span { min-width: 0; display: grid; gap: 2px; }
.inventory-options [role='option'] strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inventory-options [role='option'] small { color: var(--muted); font-size: 9px; }
.inventory-option-check { flex: 0 0 auto; visibility: hidden; color: var(--brand); }
.inventory-options [role='option'].selected .inventory-option-check { visibility: visible; }
.inventory-no-results {
    margin: 0;
    padding: 12px 10px;
    color: var(--muted);
    font-size: 10px;
}
.inventory-item-choice { min-width: 0; }
.inventory-count-field input { text-align: center; font-weight: 700; }
.inventory-add label,
.inventory-item-grid label { margin: 0 !important; }
.inventory-add button { min-height: 40px; white-space: nowrap; }
.inventory-list { display: grid; gap: 10px; }
.inventory-empty {
    padding: 18px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 11px;
}
.inventory-item {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.inventory-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.inventory-item-head > div { min-width: 0; display: grid; gap: 2px; }
.inventory-item-head strong { font-size: 12px; }
.inventory-item-head span { color: var(--muted); font-size: 10px; }
.inventory-item-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
select[data-workspace-currency='true'] {
    background-color: var(--surface-soft);
    font-weight: 650;
}
.amenity-chips {
    min-height: 42px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 7px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.amenity-chip {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 6px 5px 9px;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
}
.amenity-chip > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.amenity-chip button {
    width: 22px;
    min-height: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    color: currentColor;
    background: transparent;
    border: 0;
    border-radius: 50%;
}
.amenity-chip button:hover {
    background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.amenity-empty { padding: 3px 5px; color: var(--muted); font-size: 11px; }
.amenity-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.amenity-entry input { min-width: 0; }
.amenity-entry button { min-width: 82px; justify-content: center; }
.modal label.form-checkbox,
.modal .form-checkbox[data-field-help-field] {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.modal .form-checkbox[data-field-help-field] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}
.modal .form-checkbox[data-field-help-field] > label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}
.modal .form-checkbox input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin: 2px 0 0;
    padding: 0;
}
.form-checkbox > span:not(.field-help) { display: grid; gap: 3px; }
.form-checkbox strong { color: var(--text-subtle); font-size: 12px; }
.modal-error { min-height: 0; margin-top: 14px; }
.modal-error.error { min-height: 42px; }
.delete-target {
    display: grid;
    gap: 3px;
    margin-top: 18px;
    padding: 12px 14px;
    color: var(--text-subtle);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.delete-target span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.delete-target strong { overflow-wrap: anywhere; font-size: 13px; }
.modal label.delete-password-field { margin-top: 16px; }
.lease-form-progress {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}
.lease-form-progress li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 12px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}
.lease-form-progress li span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
}
.lease-form-progress li.active {
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
}
.lease-form-progress li.complete { color: var(--success); }
.lease-page-intro {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 9px;
}
.lease-page-intro strong { font-size: 12px; }
.lease-page-intro span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.lease-defaults-status {
    margin: 10px 0 0;
    padding: 10px 12px;
    color: var(--muted-strong);
    background: var(--surface-soft);
    border-left: 3px solid var(--brand);
    border-radius: 6px;
    font-size: 10px;
    line-height: 1.5;
}
.lease-defaults-status.error {
    color: var(--danger);
    border-left-color: var(--danger);
}
.lease-clauses-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}
.lease-clauses-grid .form-section { align-self: start; }
.lease-clauses-grid .form-grid { grid-template-columns: 1fr; }
.lease-clauses-grid textarea { min-height: 106px; }
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin: 24px -24px -22px;
    padding: 16px 24px;
    background: var(--surface-soft);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (max-width: 720px) {
    .lease-form-progress,
    .lease-clauses-grid { grid-template-columns: 1fr; }
    .lease-page-intro { display: grid; gap: 3px; }
    .lease-form-section > summary { align-items: flex-start; }
    .modal label.lease-action-confirmation { width: 100%; margin-right: 0; }
    .modal-lease .modal-actions button { flex: 1 1 auto; }
    .lease-parking-policy { align-items: flex-start; flex-direction: column; }
    .lease-parking-policy span { text-align: left; }
    .lease-parking-financials { grid-template-columns: 1fr; }
    .lease-parking-option {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .lease-parking-option em {
        grid-column: 2;
        text-align: left;
    }
}

.toast-region {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    width: min(380px, calc(100vw - 32px));
    display: grid;
    gap: 9px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    color: #f8fafc;
    background: #1d2939;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toast-in 180ms cubic-bezier(.2,.8,.2,1) both;
}
.toast.error-toast { background: #7a271a; }
.toast .icon { margin-top: 1px; color: #a5b4fc; }
.toast.error-toast .icon { color: #fda29b; }
.toast-copy { min-width: 0; flex: 1; font-size: 12px; line-height: 1.45; }
.toast-close { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; color: #d0d5dd; background: transparent; border: 0; border-radius: 5px; }

@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes progress-in { from { transform: scaleX(0); } }

@media (max-width: 1180px) {
    .content { padding-inline: 28px; }
    .kpis,
    .loading-cards,
    .boot-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .9fr); }
}

@media (max-width: 1040px) {
    .app-boot { grid-template-columns: 72px minmax(0, 1fr); }
    .boot-side { padding-inline: 16px; }
    .skeleton-brand,
    .boot-nav { display: none; }
    .app,
    .sidebar-compact .app { display: block; }
    .body { grid-column: auto; }
    .side {
        width: min(290px, 86vw);
        padding-top: 18px;
        transform: translateX(-104%);
        transition: transform 190ms cubic-bezier(.2,.75,.25,1);
        box-shadow: 18px 0 48px rgba(16,24,40,.22);
    }
    .sidebar-compact .side {
        width: min(290px, 86vw);
        padding: 18px 16px 16px;
    }
    .nav-open .side { transform: translateX(0); }
    .nav-open .nav-backdrop { visibility: visible; opacity: 1; }
    .side > .brand { padding-right: 46px; }
    .side-close {
        position: absolute;
        top: 20px;
        right: 16px;
        display: grid;
        color: #cbd5e1;
        background: rgba(255,255,255,.05);
        border-color: rgba(255,255,255,.08);
    }
    .mobile-menu { display: inline-grid; }
    .top-leading { min-width: 170px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .login { grid-template-columns: 1fr; }
    .hero {
        min-height: 260px;
        padding: 30px 38px;
    }
    .hero-content { width: 100%; margin: 0; padding: 42px 0 20px; }
    .hero h1 { max-width: 700px; font-size: 38px; }
    .hero-copy { max-width: 680px; margin-top: 15px; font-size: 14px; }
    .hero-points,
    .hero-foot { display: none; }
    .login-panel { padding: 46px 28px 64px; }
    .auth-onboarding .login-panel { padding: 34px 28px 56px; }
    .login .auth-form { padding-block: 10px; }
}

@media (max-width: 760px) {
    .boot-top { padding-inline: 20px; }
    .boot-top .skeleton:first-child { width: 130px; }
    .boot-top .skeleton:last-child { width: 40px; }
    .boot-content { padding: 28px 20px; }
    .top { height: 64px; padding: 0 16px; gap: 10px; }
    .content {
        min-height: calc(100dvh - 64px);
        padding: 27px 20px 42px;
    }
    .workspace-label { display: none; }
    .workspace { max-width: 180px; }
    .top-search { display: none; }
    .top-leading { min-width: 0; flex: 1; }
    .tss-card-navigation {
        min-height: calc(100dvh - 64px);
        padding: 26px 20px 42px;
    }
    .tss-card-navigation-heading { margin-bottom: 22px; }
    .tss-card-navigation-heading-copy h2 { font-size: 26px; }
    .tss-content-navigation {
        margin-bottom: -10px;
        padding: 16px 20px 0;
    }
    .tss-card-sections { gap: 20px; }
    .tss-card-grid { gap: 10px; }
    .tss-card-grid > button { min-height: 112px; border-radius: 18px; }
    .tss-card-account { align-items: stretch; flex-direction: column; gap: 13px; }
    .tss-card-account-actions { width: 100%; }
    .tss-card-account-actions a,
    .tss-card-account-actions button { flex: 1 1 0; }
    .top-actions { margin-left: auto; }
    .mode-switch button { min-width: 54px; padding-inline: 8px; }
    #help { display: none; }
    .heading { align-items: flex-start; flex-direction: column; gap: 17px; }
    .heading-actions { width: 100%; }
    .heading-actions .primary { margin-left: auto; }
    .dashboard-grid { gap: 14px; }
    .reports { grid-template-columns: 1fr; }
    .toolbar { flex-wrap: wrap; }
    .toolbar-search { width: 100%; flex: 1 0 100%; }
    .toolbar select { flex: 1; }
    .loading-heading { align-items: flex-start; }
}

@media (max-width: 640px) {
    .hero { min-height: 220px; padding: 24px; }
    .hero-content { padding: 36px 0 8px; }
    .hero-kicker { display: none; }
    .hero h1 { font-size: 32px; }
    .hero-copy { display: none; }
    .login-panel { place-items: start center; padding: 38px 24px 54px; }
    .login h2 { font-size: 28px; }
    .auth-onboarding .hero { display: none; }
    .auth-onboarding .login-panel {
        min-height: 100dvh;
        padding: 28px 20px 44px;
    }
    .auth-onboarding .auth-brand-mobile {
        display: inline-flex;
        margin-bottom: 34px;
    }
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-form-grid .auth-span-two { grid-column: auto; }
    .auth-progress { gap: 5px; }
    .auth-progress li { gap: 5px; font-size: 11px; }
    .auth-preference-grid { display: block; }
    .invitation-summary { padding: 14px; }
    .kpis,
    .loading-cards,
    .boot-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi { min-height: 138px; padding: 17px; }
    .kpi-value { font-size: 26px; }
    .dashboard-card { padding: 18px; }
    .collection-legend { gap: 8px; }
    .quick-links { grid-template-columns: 1fr; }
    .quick-link { min-height: 46px; display: flex; justify-content: flex-start; padding-inline: 12px; }
    .data-surface { overflow: visible; background: transparent; border: 0; box-shadow: none; }
    .toolbar {
        margin-bottom: 12px;
        padding: 13px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-xs);
    }
    .toolbar .secondary { flex: 1; }
    .rent-ledger-toolbar .toolbar-search,
    .rent-ledger-toolbar .toolbar-lease {
        min-width: 0;
        width: 100%;
        max-width: none;
        flex: 1 0 100%;
    }
    .table-summary {
        margin-bottom: 10px;
        background: transparent;
        border: 0;
        padding: 3px 1px;
    }
    .table-scroll { overflow: visible; }
    .table table,
    .table tbody { width: 100%; min-width: 0; display: block; }
    .table thead { display: none; }
    .table tbody { display: grid; gap: 10px; }
    .table tbody tr {
        display: grid;
        overflow: hidden;
        padding: 4px 0 0;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-xs);
    }
    .table tbody tr:hover,
    .table tbody tr:focus-within { background: #fff; border-color: #c7d2fe; }
    .table td {
        width: auto !important;
        min-height: 40px;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 9px 14px;
        text-align: right;
        border: 0;
    }
    .table td::before {
        flex: 0 0 auto;
        content: attr(data-label);
        color: var(--muted);
        font-size: 9px;
        font-weight: 750;
        letter-spacing: .05em;
        text-align: left;
        text-transform: uppercase;
    }
    .table td:first-child {
        min-height: 52px;
        align-items: center;
        padding-top: 13px;
        padding-bottom: 13px;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }
    .table td:first-child::before { display: none; }
    .table td:first-child strong { font-size: 13px; }
    .rent-ledger-surface .table td:first-child {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        justify-content: stretch;
        gap: 5px;
        text-align: left;
    }
    .rent-ledger-surface .rent-lease-context { width: 100%; margin-top: 0; }
    .table .action-cell {
        position: static;
        display: flex;
        justify-content: flex-end;
        padding: 10px 13px;
        background: var(--surface-soft) !important;
        border-top: 1px solid var(--border);
        box-shadow: none;
    }
    .table .action-cell::before { margin-right: auto; }
    .icon-button { width: 38px; height: 38px; }
    .modal-back [data-record-resource='expenses'] .modal-actions { bottom: 0; }
    .empty { min-height: 300px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
    .report { align-items: flex-start; flex-wrap: wrap; }
    .report-option-grid { grid-template-columns: 1fr; }
    .report-option-actions { display: grid; grid-template-columns: 1fr; }
    .report-option-actions button { width: 100%; }
    .modal-back { align-items: end; padding: 0; }
    .modal {
        width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 18px 18px 0 0;
        animation-name: sheet-in;
    }
    .form-grid { grid-template-columns: 1fr; }
    .amenity-entry { grid-template-columns: 1fr; }
    .amenity-entry button { width: 100%; }
    .inventory-add,
    .inventory-item-grid { grid-template-columns: 1fr; }
    .inventory-add button { width: 100%; }
    .form-section { padding-top: 16px; padding-bottom: 18px; }
    .form-section-collapsible > summary,
    .lease-form-section > summary { min-height: 58px; padding-right: 48px; }
    .form-section-collapsible > summary::after,
    .lease-form-section > summary::after {
        right: 2px;
        width: 30px;
        height: 30px;
        font-size: 19px;
    }
    .resource-form-section,
    .resource-form-section:last-of-type {
        margin-top: 10px;
        padding: 0;
        border-radius: 11px;
    }
    .resource-form-section > summary {
        min-height: 58px;
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
        padding: 12px 56px 12px 13px;
    }
    .resource-form-section > summary::after { right: 12px; }
    .resource-form-section > summary small { text-align: left; }
    .resource-form-section > .form-section-body { padding: 2px 13px 16px; }
    .modal-building .resource-form-section > .form-section-body { padding-top: 14px; }
    .modal-actions { position: sticky; bottom: -22px; }
    .toast-region { right: 16px; bottom: 16px; left: 16px; width: auto; }
    .loading-table { height: 360px; }
}

@media (max-width: 450px) {
    .app-boot { grid-template-columns: 1fr; }
    .boot-side { display: none; }
    .top { padding-inline: 12px; }
    .tss-card-navigation { padding: 22px 16px 36px; }
    .tss-card-navigation-heading { gap: 12px; }
    .tss-card-navigation-heading-copy > span { font-size: 11px; line-height: 1.45; }
    .tss-card-close {
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
    }
    .tss-card-close span { display: none; }
    .tss-content-navigation { padding-inline: 16px; }
    .tss-card-grid { gap: 9px; }
    .tss-card-grid > button {
        min-height: 106px;
        gap: 10px;
        padding: 13px 7px;
        border-radius: 16px;
    }
    .tss-card-grid > button .icon {
        width: 40px;
        height: 40px;
        padding: 9px;
        border-radius: 12px;
    }
    .tss-card-grid > button span { font-size: 11px; }
    .workspace { max-width: 135px; }
    .top.has-mode-switch .workspace { max-width: 90px; }
    .mode-switch button { min-width: 48px; padding-inline: 6px; font-size: 10px; }
    .top-icon,
    .mobile-menu { width: 40px; height: 40px; }
    .content { padding-inline: 16px; }
    .heading h1 { font-size: 27px; }
    .heading-actions { display: grid; grid-template-columns: 1fr; }
    .heading-actions .primary,
    .heading-actions .secondary { width: 100%; margin: 0; }
    .kpis,
    .loading-cards,
    .boot-cards { grid-template-columns: 1fr; }
    .kpi { min-height: 126px; }
    .collection-value-row { align-items: flex-start; flex-direction: column; gap: 8px; }
    .collection-legend { grid-template-columns: 1fr; }
    .legend-item { display: flex; align-items: center; justify-content: space-between; }
    .legend-item strong { margin: 0; }
    .toolbar select,
    .toolbar input[type='date'],
    .toolbar .secondary { width: 100%; flex-basis: 100%; }
    .loading-action { display: none; }
    .modal-head { padding-inline: 18px; }
    .modal-body { padding-inline: 18px; }
    .modal-actions { margin-inline: -18px; padding-inline: 18px; }
    .resource-record-form .modal-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        display: grid;
    }
    .resource-record-form .modal-actions button { width: 100%; }
}

@media (max-width: 360px) {
    .tss-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tss-card-shell #notify { display: none; }
    .top.has-mode-switch .workspace-meta,
    .top.has-mode-switch #notify { display: none; }
}

@media (forced-colors: active) {
    .tss-card-grid > button,
    .tss-card-section-control,
    .tss-card-close,
    .tss-back-to-apps { border: 1px solid CanvasText; }
    .tss-card-grid > button.active { outline: 2px solid Highlight; }
    .field-help-trigger {
        color: CanvasText;
        background: Canvas;
        border-color: CanvasText;
    }
    .field-help-trigger:hover,
    .field-help-trigger:focus-visible,
    .field-help-trigger[aria-expanded='true'] {
        color: HighlightText;
        background: Highlight;
        border-color: Highlight;
    }
    .field-help-tooltip {
        color: Canvas;
        background: CanvasText;
        border-color: CanvasText;
    }
}

@media (min-width: 769px) {
    .app .data-surface.rent-ledger-surface .table-scroll {
        max-height: var(--task-region-height, clamp(420px, calc(100dvh - 320px), 720px));
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* Cheques reuse the shared table, badges, and compact actions. */
.app .cheques-surface table { min-width: 0; }
.app .cheques-surface .name-col { width: 14%; }
.app .cheques-surface .secondary-col { width: 13%; }
.app .cheques-surface .status-col { width: 15%; }
.app .cheques-surface .detail-col { width: auto; }
.app .cheques-surface .amount-col { width: 16%; text-align: right; }
.app .cheques-surface :is(.action-heading, .action-cell) { width: calc(3 * var(--action-size) + 36px); }
.app .cheques-surface :is(th, td) { padding-inline: 12px; }
.app .cheques-surface td { height: 72px; line-height: 1.4; }
.app .cheques-surface td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app .cheques-surface td:nth-child(5) {
    text-align: right;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.app .cheques-surface .pill {
    max-width: 100%;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
}
.app .cheques-surface .cheque-details {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.app .cheques-surface .cheque-details > :is(span, small) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app .cheques-surface .cheque-details small {
    color: var(--text-tertiary);
    font-size: 11px;
}
.app .cheques-surface .row-actions {
    width: 100%;
    display: grid;
    justify-items: end;
    align-items: center;
    gap: 4px;
}
.app .cheques-surface .cheque-record-payment {
    min-height: var(--control-height);
    padding: 8px 10px;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.app .cheques-surface .cheque-record-payment .button-icon { flex: 0 0 auto; }
.app .cheques-surface .cheque-action-note {
    color: var(--text-tertiary);
    font-size: 11px;
    line-height: 1.3;
}

@media (max-width: 900px) {
    .app .cheques-surface .table-scroll {
        max-height: none;
        overflow: visible;
        scrollbar-gutter: auto;
    }
    .app .cheques-surface :is(table, tbody) {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .app .cheques-surface thead { display: none; }
    .app .cheques-surface tbody { display: grid; gap: 10px; }
    .app .cheques-surface tbody tr {
        display: grid;
        min-width: 0;
        overflow: hidden;
        padding: 0;
        background: var(--surface-raised);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-surface);
    }
    .app .cheques-surface td {
        position: static;
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: center;
        width: auto;
        min-width: 0;
        height: auto;
        min-height: 38px;
        gap: 12px;
        padding: 8px 14px;
        text-align: right;
        border: 0;
        box-shadow: none;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .app .cheques-surface td::before {
        content: attr(data-label);
        color: var(--text-tertiary);
        font-size: 10px;
        font-weight: 650;
        text-align: left;
        text-transform: uppercase;
    }
    .app .cheques-surface td:first-child {
        grid-template-columns: minmax(0, 1fr);
        min-height: 48px;
        text-align: left;
        border-bottom: 1px solid var(--border-subtle);
    }
    .app .cheques-surface td:first-child::before { display: none; }
    .app .cheques-surface td:nth-child(2) { white-space: normal; }
    .app .cheques-surface .pill { justify-self: end; }
    .app .cheques-surface .cheque-details > :is(span, small) {
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .app .cheques-surface .action-cell {
        width: auto;
        padding-block: 12px;
        border-top: 1px solid var(--border-subtle);
    }
    .app .cheques-surface .action-cell::before { display: block; }
    .app .cheques-surface .row-actions { min-width: 0; }
    .app .cheques-surface .cheque-record-payment {
        width: 100%;
        min-height: var(--control-height-touch);
        padding-inline: 8px;
        white-space: normal;
    }
}


.app .cheques-surface :is(.cheque-mobile-number, .cheque-mobile-date,
    .cheque-mobile-colon, .cheque-filter-toggle) { display: none; }
.app .cheques-surface .cheque-filter-fields { display: contents; }

/* Compact phone cards keep the existing tablet and desktop presentation. */
@media (max-width: 640px) {
    .app .cheques-surface tbody { gap: 8px; }
    .app .cheques-surface tbody tr {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            'number status'
            'bank bank'
            'details details'
            'amount actions';
        align-items: center;
        gap: 3px 10px;
        padding: 12px;
    }
    .app .cheques-surface td {
        display: block;
        min-height: 0;
        padding: 0;
        text-align: left;
        border: 0;
    }
    .app .cheques-surface td::before { display: none; }
    .app .cheques-surface td:first-child {
        grid-area: number;
        min-height: 0;
        padding: 0;
        border: 0;
    }
    .app .cheques-surface td:first-child strong { font-size: 16px; line-height: 1.3; }
    .app .cheques-surface :is(.cheque-desktop-name, .cheque-desktop-date,
        .cheque-detail-separator, .cheque-record-payment > span) { display: none; }
    .app .cheques-surface .cheque-mobile-number { display: inline; }
    .app .cheques-surface :is(.cheque-mobile-date, .cheque-mobile-colon) { display: inline; }
    .app .cheques-surface td:nth-child(2) {
        grid-area: bank;
        color: var(--text-tertiary);
        font-size: 12px;
        white-space: nowrap;
    }
    .app .cheques-surface td:nth-child(3) {
        grid-area: status;
        max-width: min(150px, 43vw);
        justify-self: end;
        text-align: right;
    }
    .app .cheques-surface .pill { padding: 3px 7px; font-size: 10px; }
    .app .cheques-surface td:nth-child(4) { grid-area: details; margin-top: 7px; }
    .app .cheques-surface .cheque-details { gap: 2px; }
    .app .cheques-surface .cheque-details > .record-detail-primary {
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .app .cheques-surface .cheque-details small {
        display: grid;
        min-width: 0;
        gap: 2px;
        font-size: 12px;
    }
    .app .cheques-surface .cheque-property {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        overflow-wrap: anywhere;
    }
    .app .cheques-surface .cheque-date { display: block; }
    .app .cheques-surface td:nth-child(5) {
        grid-area: amount;
        align-self: center;
        margin-top: 7px;
        color: var(--text-primary);
        font-size: 16px;
        font-weight: 750;
        line-height: 1.3;
        text-align: left;
    }
    .app .cheques-surface .action-cell {
        grid-area: actions;
        min-height: 44px;
        max-width: min(150px, 43vw);
        margin-top: 7px;
        padding: 0;
        border: 0;
        justify-self: end;
    }
    .app .cheques-surface .action-cell::before { display: none; }
    .app .cheques-surface .row-actions {
        display: flex;
        flex-direction: row-reverse;
        gap: 6px;
        align-items: center;
    }
    .app .cheques-surface .cheque-record-payment {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        gap: 0;
        justify-content: center;
    }
    .app .cheques-surface .cheque-record-payment .button-icon { width: 18px; height: 18px; }
    .app .cheques-surface .cheque-action-note { font-size: 10px; }
    .app .cheques-surface .toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
    }
    .app .cheques-surface .toolbar-field,
    .app .cheques-surface .toolbar-search {
        width: 100%;
        min-width: 0;
        margin: 0;
        gap: 4px;
    }
    .app .cheques-surface .toolbar :is(input, select) { width: 100%; min-width: 0; }
    .app .cheques-surface .cheque-filter-toggle { display: inline-flex; padding-inline: 10px; }
    .app .cheques-surface .cheque-filter-fields { display: none; }
    .app .cheques-surface .cheque-filter-fields.is-open {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        gap: 8px;
    }
    .app .cheques-surface .cheque-filter-fields > .secondary {
        min-width: 0;
        width: 100%;
        padding-inline: 8px;
        white-space: normal;
    }
}


/* Expense allocation stays in the shared table and becomes a compact card on small screens. */
.app .expenses-surface table { min-width: 0; }
.app .expenses-surface .expense-description { width: 16%; }
.app .expenses-surface .expense-property { width: 16%; }
.app .expenses-surface :is(.expense-supplier, .expense-category,
    .expense-status, .expense-date) { width: 10%; }
.app .expenses-surface .expense-amount { width: 14%; text-align: right; }
.app .expenses-surface :is(.action-heading, .action-cell) { width: 14%; padding-inline: 6px; }
.app .expenses-surface :is(th, td) { padding-inline: 10px; }
.app .expenses-surface td { line-height: 1.4; overflow-wrap: anywhere; }
.app .expenses-surface td strong,
.app .expenses-surface .expense-value {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}
.app .expenses-surface td small {
    display: block;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app .expenses-surface .expense-meta-separator { display: none; }
.app .expenses-surface .expense-amount { font-weight: 650; font-variant-numeric: tabular-nums; }
.app .expenses-surface .row-actions { flex-shrink: 0; }
.app .expenses-surface .pill { max-width: 100%; padding: 4px 6px; white-space: normal; }
.app .expenses-surface .expense-status .pill { font-size: 10px; white-space: nowrap; }
.app .expenses-surface td.expense-date { font-size: 11px; white-space: nowrap; }
.app .expenses-surface .toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(130px, 1fr))
        repeat(2, minmax(140px, 1fr));
    gap: 8px;
}
.app .expenses-surface .toolbar-field { min-width: 0; width: 100%; gap: 3px; }
.app .expenses-surface .toolbar :is(input, select) { min-width: 0; width: 100%; }
.app .expenses-surface .toolbar select { padding-inline: 8px 26px; }
.app .expenses-surface .filter-clear { grid-column: 4; }
.app .expenses-surface .table-summary { min-height: 30px; padding-block: 5px; }

@media (max-width: 1180px) {
    .app .expenses-surface .toolbar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .app .expenses-surface .toolbar-search { grid-column: span 2; }
    .app .expenses-surface .filter-clear { grid-column: auto; }
    .app .expenses-surface .table-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; }
    .app .expenses-surface :is(table, tbody) { display: block; width: 100%; min-width: 0; }
    .app .expenses-surface thead { display: none; }
    .app .expenses-surface tbody { display: grid; gap: 8px; }
    .app .expenses-surface tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: 'property status' 'description amount'
            'supplier category' 'date actions';
        align-items: center;
        gap: 4px 8px;
        min-width: 0;
        padding: 10px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-surface);
        background: var(--surface-raised);
    }
    .app .expenses-surface td {
        position: static;
        display: block;
        width: auto !important;
        min-width: 0;
        min-height: 0;
        height: auto;
        padding: 0;
        border: 0;
        box-shadow: none;
        text-align: left;
        line-height: 1.3;
    }
    .app .expenses-surface td::before { display: none; }
    .app .expenses-surface :is(.expense-property, .expense-description) { align-self: start; }
    .app .expenses-surface td strong { font-size: 13px; }
    .app .expenses-surface td small { margin-top: 2px; }
    .app .expenses-surface .expense-property { grid-area: property; }
    .app .expenses-surface .expense-status { grid-area: status; align-self: start; text-align: right; }
    .app .expenses-surface .expense-status .pill { white-space: normal; font-size: 10px; }
    .app .expenses-surface .expense-description { grid-area: description; }
    .app .expenses-surface .expense-supplier { grid-area: supplier; font-size: 11px; }
    .app .expenses-surface .expense-category {
        grid-area: category;
        display: flex;
        justify-content: flex-start;
        align-items: baseline;
        gap: 5px;
        color: var(--text-tertiary);
        font-size: 11px;
    }
    .app .expenses-surface .expense-meta-separator { display: inline; }
    .app .expenses-surface .expense-category .expense-value { min-width: 0; }
    .app .expenses-surface .expense-date { grid-area: date; color: var(--text-tertiary); }
    .app .expenses-surface .expense-amount {
        grid-area: amount;
        align-self: start;
        text-align: right;
        font-size: 15px;
        font-weight: 750;
    }
    .app .expenses-surface .action-cell {
        grid-area: actions;
        justify-self: end;
        background: transparent !important;
    }
    .app .expenses-surface .row-actions { display: flex; align-items: center; gap: 6px; }
    .app .expenses-surface .icon-button { width: 44px; height: 44px; min-height: 44px; }
}

@media (min-width: 641px) and (max-width: 1180px) {
    .app .expenses-surface tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .app .expenses-view .heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }
    .app .expenses-view .heading :is(.eyebrow, #resource-count) { display: none; }
    .app .expenses-view .heading-actions { width: auto; }
    .app .expenses-view .heading-actions .primary { flex: none; }
    .app .expenses-surface .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        margin-bottom: 6px;
    }
    .app .expenses-surface .toolbar-search { grid-column: 1 / -1; }
    .app .expenses-surface .toolbar :is(input, select, button) {
        height: 44px;
        min-height: 44px;
        font-size: 12px;
    }
    .app .expenses-surface .toolbar select { text-overflow: ellipsis; }
    .app .expenses-surface .toolbar input[type='date'] { padding-inline: 6px; }
    .app .expenses-surface .toolbar .secondary { width: 100%; padding-inline: 6px; }
    .app .expenses-surface .table-summary { margin-bottom: 6px; }
}

@media (max-width: 360px) {
    .app .expenses-surface .table-summary > span:last-child { display: none; }
}


/* Occupant associations share one record row, with compact cards on smaller screens. */
.app .occupants-surface table { min-width: 0; }
.app .occupants-surface .occupant-property { width: 28%; }
.app .occupants-surface .occupant-name { width: 20%; }
.app .occupants-surface .occupant-type { width: 14%; }
.app .occupants-surface .occupant-status { width: 12%; padding-inline: 6px; }
.app .occupants-surface .occupant-details { width: 12%; }
.app .occupants-surface :is(.action-heading, .action-cell) { width: 14%; padding-inline: 6px; }
.app .occupants-surface :is(th, td) { padding-inline: 10px; }
.app .occupants-surface td { line-height: 1.4; overflow-wrap: anywhere; }
.app .occupants-surface :is(td strong, .occupant-details > span) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}
.app .occupants-surface .occupant-location-summary { display: grid; gap: 2px; }
.app .occupants-surface .occupant-summary-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.app .occupants-surface :is(.occupant-property-name, .occupant-unit-name) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.app .occupants-surface .occupant-property-name { font-weight: 500; }
.app .occupants-surface .occupant-unit-summary { color: var(--text-tertiary); font-size: 11px; }
.app .occupants-surface .occupant-assignment-help { margin: 0; flex-shrink: 0; }
.app .occupants-surface .occupant-assignment-trigger {
    width: auto;
    min-width: 32px;
    height: 24px;
    min-height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: var(--border-subtle);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.occupant-assignment-tooltip {
    display: none;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: min(320px, calc(100vh - 24px));
    max-height: min(320px, calc(100dvh - 24px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.occupant-assignment-tooltip.is-visible { display: block; }
.occupant-assignment-tooltip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.occupant-assignment-group + .occupant-assignment-group { margin-top: 10px; }
.occupant-assignment-group strong { display: block; font-size: 12px; font-weight: 650; }
.occupant-assignment-group ul { margin: 3px 0 0; padding-left: 18px; }
.occupant-assignment-group li + li { margin-top: 2px; }
.app .occupants-surface .pill { max-width: 100%; padding: 4px 6px; font-size: 10px; white-space: normal; }
.app .occupants-surface .occupant-status .pill { white-space: nowrap; }
.app .occupants-surface .row-actions { flex-shrink: 0; }
.app .occupants-surface .toolbar {
    display: grid;
    grid-template-columns: minmax(8rem, 1.8fr) minmax(7rem, 1.3fr)
        minmax(6rem, 1.1fr) minmax(9.5rem, 1fr) auto auto;
    gap: 8px;
}
.app .occupants-surface .toolbar-field { min-width: 0; width: 100%; gap: 3px; }
.app .occupants-surface .toolbar :is(input, select) { min-width: 0; width: 100%; }
.app .occupants-surface .toolbar select { padding-inline: 8px 12px; text-overflow: ellipsis; }
.app .occupants-surface .toolbar .secondary { padding-inline: 10px; }
.app .occupants-surface .table-summary { min-height: 30px; padding-block: 5px; }

@media (max-width: 1180px) {
    .app .occupants-surface .toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
    .app .occupants-surface .table-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; }
    .app .occupants-surface :is(table, tbody) { display: block; width: 100%; min-width: 0; }
    .app .occupants-surface thead { display: none; }
    .app .occupants-surface tbody { display: grid; gap: 8px; }
    .app .occupants-surface tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: 'name status' 'type type' 'property property' 'details actions';
        align-items: center;
        gap: 3px 8px;
        min-width: 0;
        padding: 10px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-surface);
        background: var(--surface-raised);
    }
    .app .occupants-surface td {
        position: static;
        display: block;
        width: auto !important;
        min-width: 0;
        min-height: 0;
        height: auto;
        padding: 0;
        border: 0;
        box-shadow: none;
        text-align: left;
        line-height: 1.3;
    }
    .app .occupants-surface td::before { display: none; }
    .app .occupants-surface .occupant-property { grid-area: property; align-self: start; margin-top: 3px; }
    .app .occupants-surface td strong { font-size: 13px; }
    .app .occupants-surface .occupant-status { grid-area: status; align-self: start; text-align: right; }
    .app .occupants-surface .occupant-status .pill { max-width: min(130px, 40vw); }
    .app .occupants-surface .occupant-name { grid-area: name; align-self: start; }
    .app .occupants-surface .occupant-name strong { font-size: 14px; }
    .app .occupants-surface .occupant-assignment-trigger {
        min-width: 44px;
        height: 32px;
        min-height: 32px;
        padding-inline: 8px;
    }
    .app .occupants-surface .occupant-type { grid-area: type; font-size: 11px; color: var(--text-tertiary); }
    .app .occupants-surface .occupant-details { grid-area: details; font-size: 11px; color: var(--text-tertiary); }
    .app .occupants-surface .occupant-details.is-empty { display: none; }
    .app .occupants-surface .action-cell { grid-area: actions; justify-self: end; background: transparent !important; }
    .app .occupants-surface .row-actions { display: flex; align-items: center; gap: 6px; }
    .app .occupants-surface .icon-button { width: 44px; height: 44px; min-height: 44px; }
}

@media (min-width: 641px) and (max-width: 1040px) {
    .app .occupants-surface tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .app .occupants-view .heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }
    .app .occupants-view .heading :is(.eyebrow, #resource-count) { display: none; }
    .app .occupants-view .heading-actions { width: auto; }
    .app .occupants-view .heading-actions .primary { flex: none; }
    .app .occupants-surface .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        margin-bottom: 6px;
    }
    .app .occupants-surface :is(.toolbar-search, #export) { grid-column: 1 / -1; }
    .app .occupants-surface .toolbar :is(input, select, button) { height: 44px; min-height: 44px; font-size: 12px; }
    .app .occupants-surface .toolbar .secondary { width: 100%; padding-inline: 6px; }
    .app .occupants-surface .table-summary { margin-bottom: 6px; }
}

@media (max-width: 360px) {
    .app .occupants-surface .table-summary > span:last-child { display: none; }
}


/* Single assignments keep the text presentation and expose full names on focus or tap. */
.app .occupants-surface .occupant-assignment-single { min-width: 0; width: 100%; max-width: 100%; flex-shrink: 1; }
.app .occupants-surface .occupant-assignment-link {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 24px;
    padding: 0;
    color: inherit;
    background: transparent;
    border-color: transparent;
    border-radius: 3px;
    font-size: inherit;
    font-weight: 500;
    text-align: left;
}
.app .occupants-surface .occupant-assignment-link > span { display: block; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; text-align: left; text-overflow: ellipsis; }


/* Parking property context follows the space reference in tables and compact cards. */
.app .parking-spaces-surface table { min-width: 0; }
.app .parking-spaces-surface .name-col { width: 21%; }
.app .parking-spaces-surface .detail-col { width: 22%; }
.app .parking-spaces-surface .secondary-col { width: 14%; }
.app .parking-spaces-surface .status-col { width: 16%; }
.app .parking-spaces-surface .amount-col { width: 16%; }
.app .parking-spaces-surface :is(.action-heading, .action-cell) { width: 11%; }
.app .parking-spaces-surface :is(th, td) { padding-inline: 6px; }
.app .parking-spaces-surface td { overflow-wrap: anywhere; }
.app .parking-spaces-surface :is(td strong, .parking-property) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
}
.app .parking-spaces-surface .pill { max-width: 100%; padding: 4px 6px; font-size: 10px; white-space: nowrap; }
.app .parking-spaces-surface :is(.amount-col, [data-label='Monthly rate']) { text-align: right; }
.app .parking-spaces-surface [data-label='Monthly rate'] { font-weight: 650; font-variant-numeric: tabular-nums; }

@media (min-width: 1041px) {
    .app .parking-spaces-surface :is(.amount-col, [data-label='Monthly rate']) {
        padding-right: var(--space-4);
        white-space: nowrap;
        overflow-wrap: normal;
    }
    .app .parking-spaces-surface :is(.action-heading, .action-cell) {
        right: auto;
        padding-inline: var(--space-1);
        text-align: center;
        box-shadow: none;
    }
    .app .parking-spaces-surface .action-cell { position: static; }
    .app .parking-spaces-surface .row-actions { display: flex; justify-content: center; }
    .app .parking-spaces-surface .row-actions .icon-button { flex-shrink: 0; }
}

/* Reserve room for the full rate and existing controls above the card breakpoint. */
@media (min-width: 1041px) and (max-width: 1279px) {
    .app .parking-spaces-surface .name-col { width: 18%; }
    .app .parking-spaces-surface .detail-col { width: 20%; }
    .app .parking-spaces-surface .secondary-col { width: 12%; }
    .app .parking-spaces-surface .status-col { width: 15%; }
    .app .parking-spaces-surface .amount-col { width: 21%; }
    .app .parking-spaces-surface :is(.action-heading, .action-cell) { width: 14%; }
}

@media (max-width: 1040px) {
    .app .parking-spaces-surface .table-scroll { overflow: visible; }
    .app .parking-spaces-surface :is(table, tbody) { display: block; min-width: 0; width: 100%; }
    .app .parking-spaces-surface thead { display: none; }
    .app .parking-spaces-surface tbody { display: grid; gap: 8px; }
    .app .parking-spaces-surface tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: 'reference status' 'property property' 'type type' 'rate actions';
        align-items: center;
        gap: 4px 8px;
        min-width: 0;
        padding: 10px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-surface);
        background: var(--surface-raised);
    }
    .app .parking-spaces-surface td {
        position: static;
        display: block;
        width: auto !important;
        min-width: 0;
        min-height: 0;
        height: auto;
        padding: 0;
        border: 0;
        box-shadow: none;
        text-align: left;
        line-height: 1.3;
    }
    .app .parking-spaces-surface td::before { display: none; }
    .app .parking-spaces-surface [data-label='Space reference'] { grid-area: reference; align-self: start; }
    .app .parking-spaces-surface [data-label='Space reference'] strong { font-size: 14px; }
    .app .parking-spaces-surface [data-label='Property'] { grid-area: property; }
    .app .parking-spaces-surface [data-label='Type'] { grid-area: type; color: var(--text-tertiary); font-size: 11px; }
    .app .parking-spaces-surface [data-label='Status'] { grid-area: status; align-self: start; text-align: right; }
    .app .parking-spaces-surface [data-label='Monthly rate'] { grid-area: rate; font-size: 15px; text-align: left; }
    .app .parking-spaces-surface .action-cell { grid-area: actions; justify-self: end; background: transparent !important; }
    .app .parking-spaces-surface .row-actions { display: flex; align-items: center; gap: 6px; }
    .app .parking-spaces-surface .icon-button { width: 44px; height: 44px; min-height: 44px; }
}

@media (min-width: 641px) and (max-width: 1040px) {
    .app .parking-spaces-surface tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .app .parking-spaces-surface .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
    .app .parking-spaces-surface .toolbar-search { grid-column: 1 / -1; }
    .app .parking-spaces-surface .toolbar-field { min-width: 0; width: 100%; gap: 3px; }
    .app .parking-spaces-surface .toolbar :is(input, select, button) { min-width: 0; width: 100%; font-size: 12px; }
    .app .parking-spaces-surface .toolbar select { padding-inline: 8px 12px; text-overflow: ellipsis; }
    .app .parking-spaces-surface .toolbar .secondary { padding-inline: 6px; }
}


/* Legal terms share the lease wizard and its existing scroll container. */
.modal-lease .lease-terms-editor { min-width: 0; margin-top: 12px; }
.modal-lease .lease-terms-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    padding: 4px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.modal-lease .lease-terms-tabs button {
    min-width: 0; min-height: 44px; padding: 7px 8px;
    justify-content: center; white-space: normal; text-align: center;
    font-size: 12px; line-height: 1.25; color: var(--muted-strong);
    background: transparent; border: 1px solid transparent; border-radius: 7px;
}
.modal-lease .lease-terms-tabs button[aria-selected='true'] {
    color: var(--brand-strong); background: var(--surface);
    border-color: var(--border); box-shadow: var(--shadow-xs);
}
.modal-lease [data-lease-terms-panel] { min-width: 0; padding-top: 4px; }
.modal-lease [data-lease-next][hidden],
.modal-lease [data-lease-back][hidden],
.modal-lease [data-lease-final-action][hidden],
.modal-lease .modal-actions [type='submit'][hidden],
.modal-lease [data-lease-terms-panel][hidden],
.modal-lease [data-term-confirm][hidden],
.modal-lease [data-document-confirm][hidden],
.modal-lease [data-lease-terms-pending][hidden] { display: none; }
.modal-lease .lease-terms-help { color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.modal-lease .lease-new-term { margin-top: 10px; }
.modal-lease .lease-new-term > summary span { min-width: 0; overflow-wrap: anywhere; }
.modal-lease .lease-new-term > summary { gap: 8px; }
.modal-lease .lease-new-term textarea { min-height: 84px; resize: vertical; }
.modal-lease .lease-new-term .form-field { margin-bottom: 12px; }
.modal-lease .lease-term-actions,
.modal-lease .lease-term-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.modal-lease .lease-term-confirm { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.modal-lease .lease-term-confirm span { flex: 1 1 100%; overflow-wrap: anywhere; }
.modal-lease .lease-term-actions button,
.modal-lease .lease-term-confirm button,
.modal-lease .lease-terms-upload button { min-height: 44px; }
.modal-lease [data-lease-custom-text] { width: 100%; min-height: 132px; max-height: 55vh; resize: vertical; }
.modal-lease .lease-terms-upload { margin-top: 16px; }
.modal-lease .lease-terms-drop {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 9px;
    background: var(--surface-soft);
}
.modal-lease .lease-terms-drop > span { flex: 1 1 200px; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.modal-lease .lease-terms-drop.dragging { border-color: var(--brand); background: var(--brand-soft); }
.modal-lease [data-lease-terms-file] { display: none; }
.modal-lease .lease-terms-file-card {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-top: 10px; padding: 10px; background: var(--surface-soft);
    border: 1px solid var(--border); border-radius: 9px;
}
.modal-lease .lease-terms-file-card > div { flex: 1 1 200px; min-width: 0; display: grid; gap: 4px; }
.modal-lease .lease-terms-file-card strong { font-size: 12px; overflow-wrap: anywhere; }
.modal-lease .lease-terms-file-card small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.modal-lease .lease-terms-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.modal-lease .lease-terms-pending > span { flex: 1 1 100%; font-size: 12px; overflow-wrap: anywhere; }
.modal-lease .lease-terms-error { color: var(--danger); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; margin-top: 8px; }
.modal-lease .lease-terms-error:empty { display: none; }
.modal-lease .lease-terms-included { margin-bottom: 0; }
@media (max-width: 440px) {
    .modal-lease .lease-terms-tabs button { padding-inline: 3px; font-size: 11px; }
    .modal-lease .lease-term-actions { gap: 5px; }
    .modal-lease .lease-term-actions button { padding-inline: 8px; }
}


/* Keep Property and Unit controls aligned while availability stays in the label. */
.modal-lease :is(.lease-property-filter, .lease-unit-field) { align-self: start; align-content: start; }
.modal-lease :is(.lease-property-filter, .lease-unit-field) > .field-label-row {
    min-height: 24px; flex-wrap: wrap; row-gap: 2px;
}
.modal-lease [data-lease-unit-availability] {
    min-width: 0; margin-inline-start: auto; font-size: 11px; line-height: 1.4;
    font-weight: 400; color: var(--muted); overflow-wrap: anywhere;
}
.modal-lease [data-lease-unit-availability].error { color: var(--danger); }
.modal-lease [data-lease-unit-availability]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.modal-lease [data-lease-unit-retry] { margin: 0; min-height: 44px; }
.modal-lease [data-lease-unit-retry][hidden] { display: none; }
.modal-lease [data-lease-property], .modal-lease select[name='unit_id'] { min-width: 0; max-width: 100%; }


/* Deferred included parking remains part of the existing lease picker. */
.modal .lease-parking-deferred { min-height: 44px; padding-block: 8px; }
.modal .lease-parking-deferred[hidden],
.lease-parking-picker [hidden],
.modal-lease-parking-assignment [data-parking-assignment-retry][hidden] { display: none; }
.modal .lease-parking-deferred small { color: var(--muted); line-height: 1.4; }
.lease-parking-assignment-status { margin: 0; color: var(--text-subtle); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.lease-row-parking-assignment small { white-space: normal; }
.modal-lease-parking-assignment { width: min(620px, 100%); }
.modal-lease-parking-assignment [data-lease-parking-assignment-fields] { min-width: 0; }
.modal-lease-parking-assignment [data-parking-assignment-retry] { min-height: 44px; }


/* Previous-lease autofill feedback shares the compact lease confirmation styles. */
.modal-lease .lease-template-feedback { min-width: 0; margin-bottom: 12px; }
.modal-lease .lease-template-feedback[hidden],
.modal-lease .lease-template-confirm[hidden] { display: none; }
.modal-lease .lease-template-feedback .lease-defaults-status { margin-bottom: 8px; overflow-wrap: anywhere; }
.modal-lease .lease-template-confirm { flex-wrap: wrap; gap: 8px; }
.modal-lease .lease-template-confirm > span { flex: 1 0 100%; min-width: 0; }
.modal-lease .lease-template-confirm button { min-height: 44px; }


/* Shared document library and upload controls use the existing form/button styles. */
.modal.modal-documents { width: min(760px, 100%); }
.modal-documents .modal-title-wrap, .modal-documents .modal-title-wrap > div { min-width: 0; }
.modal-documents .modal-description { overflow-wrap: anywhere; }
.modal-documents .modal-body { padding-top: 14px; }
.modal-documents [hidden] { display: none !important; }
.modal-documents .document-upload-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); gap: 12px; }
.modal-documents label { min-width: 0; margin: 0; }
.modal-documents input, .modal-documents select, .modal-documents textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
.modal-documents textarea { min-height: 44px; height: 44px; max-height: 120px; resize: vertical; }
.modal-documents .document-upload-fields select { min-height: 44px; }
.modal-documents .document-drop-zone { display: grid; justify-items: center; gap: 5px; border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 14px; margin-top: 12px; text-align: center; background: var(--surface-soft); }
.modal-documents .document-drop-zone > strong { font-size: 13px; }
.modal-documents .document-drop-zone > span { color: var(--muted); font-size: 12px; }
.modal-documents .document-drop-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 28px; }
.modal-documents .document-drop-icon .icon { width: 24px; height: 24px; }
.modal-documents [data-doc-browse] { margin-block: 5px; }
.modal-documents .document-drop-zone .form-hint { margin: 2px 0 0; max-width: 100%; font-size: 11px; line-height: 1.5; }
.modal-documents .document-drop-zone.is-dragging { border-color: var(--brand); background: var(--surface-soft); }
.modal-documents .document-replace-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; margin-block: 8px; }
.modal-documents .document-replace-notice > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.modal-documents input[type=file][hidden] { display: none; }
.modal-documents button { min-height: 40px; }
.modal-documents .modal-close { flex-shrink: 0; width: 40px; height: 40px; }
.modal-documents .document-upload-queue, .modal-documents .document-items { list-style: none; margin: 12px 0; padding: 0; }
.modal-documents .document-upload-queue li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-block: 9px; }
.modal-documents .document-queue-file { min-width: 0; display: flex; align-items: center; gap: 8px; flex: 1; }
.modal-documents .document-queue-file > div { min-width: 0; display: grid; gap: 3px; }
.modal-documents .document-thumbnail, .modal-documents .document-file-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--surface-soft); color: var(--muted); overflow: hidden; }
.modal-documents .document-thumbnail img, .modal-documents img.document-thumbnail { width: 48px; height: 48px; object-fit: cover; }
.modal-documents .document-file-icon { flex-direction: column; gap: 1px; }
.modal-documents .document-file-icon .icon { width: 22px; height: 22px; }
.modal-documents .document-file-icon small { color: var(--muted); font-size: 8px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.modal-documents .document-item-content { display: flex; align-items: flex-start; min-width: 0; gap: 10px; }
.modal-documents .document-upload-queue strong, .modal-documents .document-item-copy strong { overflow-wrap: anywhere; font-size: 12px; }
.modal-documents .document-item-copy > span, .modal-documents .document-item-copy > small { overflow-wrap: anywhere; }
.modal-documents .document-upload-queue small, .modal-documents .document-item-copy small { color: var(--muted); font-size: 11px; }
.modal-documents .document-upload-queue span { font-size: 11px; overflow-wrap: anywhere; }
.modal-documents .document-queue-actions { display: flex; align-items: center; flex-shrink: 0; gap: 4px; }
.modal-documents .document-upload-progress { display: grid; gap: 5px; margin-block: 10px; font-size: 12px; }
.modal-documents progress { width: 100%; height: 8px; accent-color: var(--brand); }
.modal-documents .document-upload-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.modal-documents .document-library { margin: 0; padding: 0; }
.modal-documents .document-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-documents .document-section-heading h3, .modal-documents .document-upload-title { margin: 0; font-size: 13px; font-weight: 750; }
.modal-documents .document-section-heading span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.modal-documents .document-empty { padding: 10px 0; margin: 0; text-align: left; font-size: 12px; }
.modal-documents [data-doc-upload] { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-documents .document-upload-title { margin-bottom: 12px; }
.modal-documents .document-selected-heading { margin-top: 14px; }
.modal-documents .document-selected-heading h4 { margin: 0; font-size: 12px; }
.modal-documents .document-items > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; padding-block: 12px; border-bottom: 1px solid var(--border); }
.modal-documents .document-item-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.modal-documents .document-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-documents .document-item-copy span { color: var(--muted); font-size: 11px; }
.modal-documents .document-item-copy p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); }
.modal-documents .document-item-actions { display: flex; align-items: center; gap: 5px; }
.modal-documents .document-item-actions button { padding-inline: 10px; font-size: 11px; }
.modal-documents .document-action-menu { position: relative; }
.modal-documents [data-doc-menu-toggle] { width: 40px; padding: 0; }
.modal-documents .document-action-options { position: absolute; z-index: 8; right: 0; top: calc(100% + 5px); display: grid; gap: 2px; width: 172px; max-width: calc(100vw - 48px); padding: 5px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.modal-documents .document-action-options.is-above { top: auto; bottom: calc(100% + 5px); }
.modal-documents .document-action-options button { display: flex; align-items: center; gap: 8px; border: 0; box-shadow: none; background: transparent; text-align: left; font-size: 12px; }
.modal-documents .document-action-options button:hover, .modal-documents .document-action-options button:focus-visible { background: var(--surface-soft); }
.modal-documents .document-action-options button.danger { color: var(--danger); }
.modal-documents .document-remove-confirm { grid-column: 1 / -1; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.modal-documents .document-remove-confirm p { margin: 0 0 8px; font-size: 12px; }
.record-document-section { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-width: 0; padding: 14px; margin-block: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.record-document-section > div { min-width: 0; flex: 1 1 200px; }
.record-document-section h3 { font-size: 14px; margin: 0 0 4px; }
.record-document-section p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.record-document-section button { max-width: 100%; min-height: 44px; white-space: normal; }
.app .row-actions:has(.document-action) { flex-wrap: wrap; }
.app .document-action { flex-shrink: 0; }
.rp-row-actions .document-action { min-height: 44px; min-width: 44px; }
@media (max-width: 640px) {
    .modal-documents .document-upload-fields { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .modal-documents .document-items > li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .modal-documents .document-item-actions { justify-self: end; }
    .modal-documents [data-doc-menu-toggle] { width: 44px; }
    .modal-documents button, .modal-documents select, .modal-documents input { min-height: 44px; }
    .modal-documents .modal-close { width: 44px; height: 44px; }
    .modal-documents .document-upload-queue li { flex-wrap: wrap; }
    .modal-documents .document-queue-actions { margin-left: auto; }
    .app .document-action { width: 44px; height: 44px; min-height: 44px; }
}

.payment-document-panel > summary { cursor: pointer; font-weight: 700; min-height: 44px; padding-block: 12px; }
.payment-document-panel > ul { list-style: none; margin: 0; padding: 0; }
.payment-document-panel li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 8px; border-top: 1px solid var(--border); }
.payment-document-panel li > div { display: grid; min-width: 0; gap: 3px; }
.payment-document-panel strong { overflow-wrap: anywhere; font-size: 12px; }
.payment-document-panel small { color: var(--muted); font-size: 11px; }
.payment-document-panel .document-action { flex-shrink: 0; }

.parking-document-actions { display: flex; align-items: center; gap: 8px; }
.parking-document-actions > .document-action { flex: 0 0 40px; width: 40px; height: 44px; }
.parking-document-actions > [data-parking-approval-review] { flex: 1; min-width: 0; min-height: 44px; }

@media (max-width: 640px) {
    .app .parking-document-actions > .document-action { flex-basis: 44px; width: 44px; min-width: 44px; }
}

/* Shared row actions reuse the existing tooltip layer, including inside dialogs. */
:root { --action-size: 40px; }
.action-icon {
    display: inline-flex;
    position: relative;
    flex: 0 0 var(--action-size);
    width: var(--action-size);
    height: var(--action-size);
    vertical-align: middle;
    align-items: center;
    justify-content: center;
}
:is(.app, .modal-back) .action-icon > .action-icon-button.icon-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 var(--action-size);
    width: var(--action-size);
    min-width: var(--action-size);
    max-width: var(--action-size);
    height: var(--action-size);
    min-height: var(--action-size);
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted-strong);
    text-decoration: none;
    line-height: 1;
    box-shadow: none;
}
:is(.app, .modal-back) .action-icon > .action-icon-button.icon-button .button-icon {
    width: 17px;
    height: 17px;
}
:is(.app, .modal-back) .action-icon > .action-icon-button:not(.action-icon-state):not(:disabled):not([aria-disabled='true']):hover {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand);
}
:is(.app, .modal-back) .action-icon > .action-icon-button.danger:not(:disabled):hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: var(--danger);
}
.action-icon:focus-visible, .action-icon > .action-icon-button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
:is(.app, .modal-back) .action-icon > .action-icon-state.icon-button {
    color: var(--muted);
    background: var(--surface-soft);
    cursor: help;
}
.action-icon-button:disabled, .action-icon-button[aria-disabled='true'] {
    opacity: .5;
    cursor: not-allowed;
}
:is(.row-actions, .rp-row-actions, .tenant-row-actions, .staff-actions,
    .work-card-actions, .profile-actions, .dialog-row-actions, .occupancy-request-actions,
    .document-item-actions, .document-queue-actions, .lease-term-actions):has(.action-icon) {
    display: flex;
    align-items: center;
    gap: 6px;
}
.app .cheques-surface .row-actions:has(.action-icon) {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 6px;
}
@media (max-width: 900px), (pointer: coarse) {
    :root { --action-size: 44px; }
}

.action-menu-options {
    display: grid;
    width: max-content;
    max-width: calc(100vw - 24px);
    gap: 3px;
    padding: 5px;
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.action-menu-options .action-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font-size: 12px;
    white-space: normal;
}
.action-menu-options .action-menu-item:hover,
.action-menu-options .action-menu-item:focus-visible { background: var(--brand-soft); }
.action-menu-item .button-icon { flex-shrink: 0; }

/* Hidden fixed tooltips must not enlarge the page's scrollable area. */
.action-icon-tooltip:not(.is-visible) { display: none; }

@media (max-width: 640px) {
    .app .data-surface.table:not(:is(.cheques-surface, .expenses-surface, .occupants-surface, .parking-spaces-surface, .units-surface)) tbody tr {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }
    .app .data-surface.table:not(:is(.cheques-surface, .expenses-surface, .occupants-surface, .parking-spaces-surface, .units-surface)) td {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .app .data-surface.table:not(:is(.cheques-surface, .expenses-surface, .occupants-surface, .parking-spaces-surface, .units-surface)) td > :not(.row-actions) {
        min-width: 0;
    }
}

/* Reserve one line for shared controls instead of growing financial rows. */
@media (min-width: 641px) {
    .app .data-surface.table:not(:is(.cheques-surface, .expenses-surface, .occupants-surface, .parking-spaces-surface, .units-surface)) :is(.action-heading, .action-cell) { width: calc(2 * var(--action-size) + 38px); }
    .app .data-surface.table:not(:is(.cheques-surface, .expenses-surface, .occupants-surface, .parking-spaces-surface, .units-surface)) table:has(.row-actions > .action-icon:nth-child(3)) :is(.action-heading, .action-cell) { width: calc(3 * var(--action-size) + 44px); }
    .app .data-surface.table:not(:is(.cheques-surface, .expenses-surface, .occupants-surface, .parking-spaces-surface, .units-surface)) .detail-col { width: auto; }
}
@media (min-width: 1041px) {
    .app .parking-spaces-surface table:has(.row-actions > .action-icon:nth-child(3)) :is(.action-heading, .action-cell) { width: calc(3 * var(--action-size) + 24px); }
    .app .parking-spaces-surface table:has(.row-actions > .action-icon:nth-child(3)) .detail-col { width: auto; }
}
@media (min-width: 1181px) {
    .app .expenses-surface table:has(.row-actions > .action-icon:nth-child(3)) :is(.action-heading, .action-cell) { width: calc(3 * var(--action-size) + 24px); }
    .app .expenses-surface table:has(.row-actions > .action-icon:nth-child(3)) .expense-description { width: auto; }
}
@media (max-width: 640px) {
    .app .expenses-surface .action-cell { padding-inline: 0; }
    .app .expenses-surface tbody tr:has(.row-actions > .action-icon:nth-child(3)) { grid-template-columns: minmax(0, 1fr) minmax(calc(3 * var(--action-size) + 12px), 1fr); }
}

/* Units share one set of cells across desktop tables and compact mobile cards. */
.app .units-surface table { min-width: 0; }
.app .units-surface .unit-name { width: 18%; }
.app .units-surface .unit-property { width: auto; }
.app .units-surface .unit-tenant { width: 22%; }
.app .units-surface .unit-type { width: 12%; }
.app .units-surface .unit-status { width: 12%; }
.app .units-surface :is(th, td) { padding-inline: 8px; }
.app .units-surface :is(.action-heading, .action-cell) {
    width: calc(3 * var(--action-size) + 28px);
    text-align: right;
    box-shadow: none;
}
.app .units-surface .action-cell { position: static; }
.app .units-surface .row-actions { flex-wrap: nowrap; }
.app .units-surface :is(.unit-name strong, .unit-property > span, .unit-tenant > span, .unit-type > span) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app .units-surface .pill { max-width: 100%; padding: 4px 6px; font-size: 10px; }
.app .units-surface .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr) auto auto;
}
.app .units-surface .toolbar-search { width: 100%; margin-right: 0; }
.app .units-surface .toolbar-field { min-width: 0; width: 100%; }
.app .units-surface .toolbar :is(input, select) { min-width: 0; width: 100%; }
.app .units-surface .toolbar select { text-overflow: ellipsis; }

/* Reserve badge and control space beside the expanded sidebar on small laptops. */
@media (min-width: 1041px) and (max-width: 1279px) {
    .app .units-surface .unit-name { width: 16%; }
    .app .units-surface .unit-tenant { width: 20%; }
    .app .units-surface .unit-status { width: 16%; }
}

@media (max-width: 1040px) {
    .app .data-surface.units-surface .table-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; }
    .app .units-surface :is(table, tbody) { display: block; width: 100%; min-width: 0; }
    .app .units-surface thead { display: none; }
    .app .units-surface tbody { display: grid; gap: 8px; }
    .app .units-surface tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: 'name status' 'property property' 'tenant tenant' 'type actions';
        align-items: center;
        gap: 4px 8px;
        min-width: 0;
        padding: 10px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-surface);
        background: var(--surface-raised);
    }
    .app .units-surface tbody tr:has(.unit-tenant.is-empty) {
        grid-template-areas: 'name status' 'property property' 'type actions';
    }
    .app .units-surface td {
        position: static;
        display: block;
        width: auto !important;
        min-width: 0;
        min-height: 0;
        height: auto;
        padding: 0;
        border: 0;
        box-shadow: none;
        text-align: left;
        line-height: 1.3;
    }
    .app .units-surface td::before { display: none; }
    .app .units-surface .unit-name { grid-area: name; }
    .app .units-surface .unit-name strong { font-size: 14px; }
    .app .units-surface .unit-property { grid-area: property; }
    .app .units-surface .unit-tenant { grid-area: tenant; }
    .app .units-surface .unit-tenant.is-empty { display: none; }
    .app .units-surface .unit-status { grid-area: status; text-align: right; }
    .app .units-surface .unit-type { grid-area: type; font-size: 11px; color: var(--text-tertiary); }
    .app .units-surface .action-cell { grid-area: actions; justify-self: end; background: transparent !important; }
    .app .units-surface .row-actions { --action-size: 44px; }
}

@media (min-width: 641px) and (max-width: 1040px) {
    .app .units-surface tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .app .units-surface .toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        margin-bottom: 6px;
    }
    .app .units-surface .toolbar-search { grid-column: 1 / -1; }
    .app .units-surface .toolbar-field { width: 100%; gap: 3px; }
    .app .units-surface .toolbar :is(input, select, button) { width: 100%; min-width: 0; min-height: 44px; font-size: 12px; }
    .app .units-surface .toolbar select { padding-inline: 8px 12px; }
    .app .units-surface .toolbar .secondary { padding-inline: 6px; }
    .app .units-surface .table-summary { margin-bottom: 6px; }
}
@media (max-width: 360px) {
    .app .units-surface .table-summary > span:last-child { display: none; }
}
