/* ============================================================
   app.css — reset, app shell (FLOATING nav + full-bleed content),
   typography, and the shared component kit. Every size / colour /
   font comes from theme.css tokens — change them THERE, once.
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/* the hidden attribute must win over component display rules (e.g. .side-link{display:flex})
   — this is what makes permission gating actually hide nav tabs and buttons */
[hidden] { display: none !important; }
html,
body {
    height: 100%;
}
body {
    font-family: var(--font);
    font-size: var(--fs-body);
    font-weight: var(--fw-body);
    background: var(--bg);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    transition:
        background 0.2s ease,
        color 0.2s ease;
    --nav-gap: 240px; /* content offset for the flat full-height nav (default pages) */
}
body[data-page="parcels"]:not(.view-list):not(.view-detail):not(
        .nav-collapsed
    ) {
    --nav-gap: 272px;
} /* only the floating map view pushes content further right */
body.nav-collapsed {
    --nav-gap: 72px;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    font-family: inherit;
    cursor: pointer;
}

/* ───────────────────────── Typography ──────────────────────── */
h1 {
    font-size: var(--fs-h1);
    font-weight: var(--fw-heading);
    color: var(--text-heading);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h2 {
    font-size: var(--fs-h2);
    font-weight: var(--fw-heading);
    color: var(--text-heading);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
h3 {
    font-size: var(--fs-h3);
    font-weight: var(--fw-subheading);
    color: var(--text-heading);
    line-height: 1.3;
}
.subheading {
    font-size: var(--fs-subheading);
    font-weight: var(--fw-subheading);
    color: var(--text-subheading);
}
p {
    font-size: var(--fs-body);
    color: var(--text-body);
}
.hint,
.muted {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    font-weight: var(--fw-body);
}

/* ─────────── App shell — content fills the viewport, nav floats ─────────── */
.layout {
    min-height: 100vh;
}
.main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#topbar {
    display: none;
}

/* Nav: flat & full-height by default; floats with rounded corners only on the map view */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    color: var(--side-text);
    border: 1px solid var(--side-border);
    border-radius: 0;
    box-shadow: var(--shadow);
    background:
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px) 0
            0/30px 30px,
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px)
            0 0/30px 30px,
        radial-gradient(
            130% 45% at 50% -5%,
            rgba(249, 115, 22, 0.14),
            transparent 60%
        ),
        linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
    transition:
        transform 0.26s ease,
        opacity 0.26s ease,
        left 0.3s ease,
        top 0.3s ease,
        bottom 0.3s ease,
        border-radius 0.3s ease;
    animation: nav-in 0.45s ease both;
}
/* only the map view gets the floating, rounded nav (transitions morph it to/from flat) */
body[data-page="parcels"]:not(.view-list):not(.view-detail) #sidebar {
    left: 16px;
    top: 16px;
    bottom: 16px;
    border-radius: var(--radius-lg);
}
body.nav-collapsed #sidebar {
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
    animation: none;
}

/* Floating reopen button — shown only when the nav is collapsed */
#navOpen {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: var(--side-text-strong);
    border: 1px solid var(--side-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
}
body.nav-collapsed #navOpen {
    display: flex;
}
body.view-detail #navOpen{display:none} /* the detail view has its own Back pill — avoid overlap */

/* nav header: brand (white, pops) + collapse button */
.side-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px 10px;
}
.side-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.side-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-bright));
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(234, 108, 10, 0.6);
}
.side-logo svg {
    width: 16px;
    height: 16px;
}
.side-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-brand-name b {
    color: var(--brand-bright);
    font-weight: 800;
}
.side-collapse {
    flex: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--side-border);
    color: var(--side-text);
}
.side-collapse:hover {
    background: var(--side-hover);
    color: var(--side-text-strong);
}

.side-nav {
    position: relative;
    flex: 1; /* fill the space so links sit at the TOP (not centered by the sidebar's space-between) */
    min-height: 0; /* allow scrolling when there are many tabs */
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.side-section {
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--side-text);
    opacity: 0.55;
    margin: 14px 10px 4px;
}
.side-link {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #c2cbd9;
    transition: color 0.15s;
}
.side-parent { width: 100%; background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit; text-align: left; }
.side-caret { margin-left: auto; display: inline-flex; opacity: .55; transition: transform 0.2s; }
.side-group.open .side-caret { transform: rotate(90deg); }
.side-group.has-on > .side-parent { color: #fff; }
.side-sub { overflow: hidden; max-height: 0; transition: max-height 0.22s ease; }
.side-group.open .side-sub { max-height: 220px; }
.side-sub .side-link { padding: 7px 11px 7px 40px; font-size: 0.85rem; }
/* the Admin button (nav.js): set apart at the foot of the main menu, with a small lock — it asks for the dev
   passcode. The admin nav's "Lock admin" reuses the same separator. */
.side-gate { margin-top: 14px; }
.side-gate::before { content: ""; position: absolute; left: 4px; right: 4px; top: -8px; border-top: 1px solid var(--side-border); }
.side-gate-lock { margin-left: auto; display: inline-flex; opacity: 0.5; }
/* the Admin area's own nav: FLAT (plain links under headings), shown in place of the main nav while inside */
.side-btn { width: 100%; background: none; border: none; text-align: left; cursor: pointer; }
.side-exit { margin-bottom: 2px; color: var(--side-text-strong); }
.side-brand-admin { display: none; }
#sidebar.is-admin .side-brand-admin { display: inline; }
/* the dev area reads like an editor: flat panel (no grid, no glow) and monospace type */
#sidebar.is-admin { background: var(--side-bg-2); }
#sidebar.is-admin .side-brand-name,
#sidebar.is-admin .side-nav { font-family: var(--mono); letter-spacing: 0; }
#sidebar.is-admin .side-link { font-size: 0.84rem; }
#sidebar.is-admin .side-section { letter-spacing: 0.06em; }
.side-link:hover {
    color: #fff;
}
.side-link.on {
    color: #fff;
    font-weight: 600;
}
/* the active accent — one element that GLIDES to the current page */
.nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    background: #1e2b45;
    border-radius: 7px;
    box-shadow: inset 3px 0 0 var(--side-active);
    transition:
        top 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        left 0.28s ease,
        width 0.28s ease,
        height 0.28s ease,
        opacity 0.2s ease;
}
.side-ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0.85;
}
.side-ico svg {
    display: block;
}
.side-link:hover .side-ico,
.side-link.on .side-ico {
    opacity: 1;
}

/* nav foot: avatar + logout + app version */
.side-foot {
    padding: 12px;
    border-top: 1px solid var(--side-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.side-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.side-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-bright));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}
.side-user-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--side-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-logout {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--side-border);
    color: var(--side-text);
    transition:
        background 0.15s,
        color 0.15s;
}
.side-logout:hover {
    background: var(--side-hover);
    color: var(--side-text-strong);
}
.side-version {
    font-size: var(--fs-small);
    color: var(--side-text);
    opacity: 0.55;
    text-align: center;
    letter-spacing: 0.04em;
}

/* nav entrance: panel fades/slides in, regions reveal top-to-bottom */
@keyframes nav-in {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes nav-region-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.side-head {
    animation: nav-region-in 0.4s ease 0.05s both;
}
.side-nav {
    animation: nav-region-in 0.4s ease 0.13s both;
}
.side-foot {
    animation: nav-region-in 0.4s ease 0.21s both;
}
@media (prefers-reduced-motion: reduce) {
    #sidebar,
    .side-head,
    .side-nav,
    .side-foot {
        animation: none;
    }
}

/* ───────────────────────── Content ─────────────────────────── */
.content {
    padding: 26px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}
/* route pages (Residents, etc.) clear the floating sidebar — the map view handles it via overlays */
#routeView {
    max-width: none;
    margin: 0;
    padding-top: 14px;
    padding-left: calc(var(--nav-gap) + 12px);
    transition: padding-left 0.26s ease;
}
/* nav is an overlay on mobile — let route content use the full width */
@media (max-width: 640px) {
    #routeView { padding-left: 14px; padding-right: 14px; }
}
.page-intro {
    margin-bottom: 20px;
}
.page-intro p {
    color: var(--text-hint);
    margin-top: 4px;
}
.coming-soon {
    min-height: 62vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}
.coming-soon.set-soon .hint { max-width: 420px; }
.soon-tag {
    margin-top: 10px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent);
    border-radius: 999px;
    padding: 4px 12px;
}
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.toolbar .spacer {
    flex: 1;
}

/* ───────────────────────── Cards ───────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.card h3 {
    margin-bottom: 6px;
}
.card p {
    color: var(--text-hint);
}
.card-ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ico-bg);
    margin-bottom: 12px;
}

/* stat tiles */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
}
.stat .lbl {
    font-size: var(--fs-small);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-hint);
}
.stat .num {
    font-size: 1.9rem;
    font-weight: var(--fw-heading);
    letter-spacing: -0.02em;
    margin-top: 6px;
    color: var(--stat-num);
}
.stat .sub {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    margin-top: 4px;
}
.stat .sub.up {
    color: var(--ok);
}
.stat .sub.down {
    color: var(--bad);
}

/* ───────────────────────── Buttons ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 600;
    transition:
        transform 0.12s,
        background 0.15s,
        box-shadow 0.15s;
}
.btn:not(.btn-primary):hover {
    background: var(--surface-2);
} /* don't bleach the primary's orange on hover */
.btn:active {
    transform: translateY(1px);
}
.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-bright));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px -8px rgba(234, 108, 10, 0.55);
}
.btn-primary:hover {
    filter: brightness(1.07);
    box-shadow: 0 10px 24px -8px rgba(234, 108, 10, 0.62);
}
.btn-ghost {
    background: transparent;
}
.btn-sm {
    padding: 7px 12px;
    font-size: 0.82rem;
}

/* ───────────────────────── Inputs ──────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.field label {
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-hint);
}
.input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--field-bg);
    color: var(--text-body);
    font-size: 0.95rem;
    font-family: inherit;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
select.input { padding-top: 0; padding-bottom: 0; height: 42px; } /* matches the text-input height; compact grids override */
.input:focus {
    outline: none;
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}
.input-search {
    position: relative;
}

/* ───────────────────────── Table ───────────────────────────── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table thead th {
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-hint);
    background: var(--surface-2);
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table tbody tr:hover {
    background: var(--surface-2);
}
.table .num {
    font-family: var(--mono);
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: var(--fs-small);
    font-weight: 700;
}
.badge.ok {
    background: rgba(21, 128, 61, 0.12);
    color: var(--ok);
}
.badge.warn {
    background: rgba(217, 119, 6, 0.14);
    color: var(--warn);
}
.badge.bad {
    background: rgba(220, 38, 38, 0.12);
    color: var(--bad);
}

/* dashed "to build" placeholder */
.placeholder {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 34px;
    text-align: center;
    color: var(--text-hint);
    background: var(--surface-2);
}
.placeholder .pl-ico {
    display: block;
    margin-bottom: 10px;
}
.placeholder b {
    color: var(--text-heading);
}

/* ───────────────────────── Login page ──────────────────────── */
.login-wrap {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(
        120% 120% at 50% -10%,
        var(--surface-2) 0%,
        var(--bg) 60%
    );
}
.login-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(
        80% 70% at 50% 40%,
        #000,
        transparent 80%
    );
    mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent 80%);
}
.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 30px;
    box-shadow: var(--shadow);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    justify-content: center;
    margin-bottom: 8px;
}
.login-brand .side-logo {
    width: 40px;
    height: 40px;
}
.login-brand .side-logo svg {
    width: 20px;
    height: 20px;
}
.login-brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-heading);
}
.login-brand-name b {
    color: var(--brand-bright);
}
.login-sub {
    text-align: center;
    color: var(--text-hint);
    font-size: 0.88rem;
    margin-bottom: 26px;
}
.login-error {
    color: var(--bad);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
    min-height: 1.1rem;
    margin: -2px 0 4px;
}
.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
    padding: 12px;
}
.login-foot {
    text-align: center;
    font-size: var(--fs-hint);
    color: var(--text-hint);
    margin-top: 20px;
}

/* ── Login page — motion. Slow and quiet: soft light drifting behind the card, the grid gliding one cell at a time,
      a thin orange light travelling round the card, and the card rising in with its parts arriving in turn.
      Everything is transform/opacity (cheap to animate); a device set to reduce motion gets a still page. ── */
.login-fx{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.login-fx span{position:absolute;border-radius:50%;will-change:transform}
.login-fx span:nth-child(1){width:52vmax;height:52vmax;left:-16vmax;top:-18vmax;
  background:radial-gradient(circle at center,rgba(249,115,22,.30) 0%,rgba(249,115,22,.10) 38%,transparent 68%);animation:login-drift-a 24s ease-in-out infinite alternate}
.login-fx span:nth-child(2){width:60vmax;height:60vmax;right:-22vmax;bottom:-26vmax;
  background:radial-gradient(circle at center,rgba(37,99,235,.28) 0%,rgba(37,99,235,.09) 40%,transparent 68%);animation:login-drift-b 28s ease-in-out infinite alternate}
.login-fx span:nth-child(3){width:34vmax;height:34vmax;left:58%;top:4%;
  background:radial-gradient(circle at center,rgba(245,158,11,.18) 0%,transparent 66%);animation:login-drift-c 32s ease-in-out infinite alternate}
@keyframes login-drift-a{0%{transform:translate(0,0) scale(1)}50%{transform:translate(14vmax,9vmax) scale(1.12)}100%{transform:translate(6vmax,18vmax) scale(.96)}}
@keyframes login-drift-b{0%{transform:translate(0,0) scale(1)}50%{transform:translate(-12vmax,-8vmax) scale(1.08)}100%{transform:translate(-20vmax,-2vmax) scale(1.15)}}
@keyframes login-drift-c{0%{transform:translate(0,0)}100%{transform:translate(-28vmax,22vmax)}}
/* the grid glides one cell, then starts over where it began: a seamless loop */
.login-wrap::before{animation:login-grid 30s linear infinite}
@keyframes login-grid{to{background-position:46px 46px,46px 46px}}
/* the card sits above the light; a thin orange light runs round its edge (an animatable angle: @property) */
@property --login-a{syntax:"<angle>";inherits:false;initial-value:0deg}
.login-card{z-index:1;animation:login-in .8s cubic-bezier(.22,1,.36,1) both}
.login-card::before{content:"";position:absolute;inset:-1px;border-radius:inherit;padding:1px;pointer-events:none;
  background:conic-gradient(from var(--login-a),transparent 0deg,transparent 250deg,rgba(249,115,22,.0) 260deg,rgba(249,115,22,.85) 320deg,rgba(251,191,36,.9) 335deg,transparent 360deg);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);
  animation:login-spin 7s linear infinite;opacity:.9}
@keyframes login-spin{to{--login-a:360deg}}
@keyframes login-in{from{opacity:0;transform:translateY(22px) scale(.97)}to{opacity:1;transform:none}}
.login-card > *{animation:login-rise .6s cubic-bezier(.22,1,.36,1) backwards}
.login-card > :nth-child(1){animation-delay:.18s}
.login-card > :nth-child(2){animation-delay:.26s}
.login-card > :nth-child(3){animation-delay:.34s}
.login-card > :nth-child(4){animation-delay:.42s}
@keyframes login-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.login-brand .side-logo{animation:login-pop .7s cubic-bezier(.34,1.56,.64,1) .2s backwards}
@keyframes login-pop{from{opacity:0;transform:scale(.6) rotate(-12deg)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  .login-fx span,.login-wrap::before,.login-card,.login-card::before,.login-card > *,.login-brand .side-logo{animation:none}
  .login-card::before{display:none}
}

/* ── the Admin passcode prompt (#admin, admin.js) — the login card's look, inside the app ── */
.adm-gate { min-height: 72vh; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.adm-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 28px; box-shadow: var(--shadow); }
.adm-ico { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.adm-sub { margin: 4px 0 20px; font-size: 0.88rem; color: var(--text-hint); }
.adm-sub code { font-family: var(--mono); font-size: 0.82rem; color: var(--text-heading); }
.adm-card .field { text-align: left; }
.adm-err { min-height: 1.1rem; margin: -4px 0 8px; font-size: 0.84rem; font-weight: 600; color: var(--bad); }
.adm-card .btn { justify-content: center; }
.adm-go { padding: 12px; }
.adm-note { margin: 10px 0 2px; font-size: var(--fs-hint); color: var(--text-hint); }
.adm-back { margin-top: 6px; border-color: transparent; }

/* ───────────────────────── Responsive ──────────────────────── */
@media (max-width: 900px) {
    #navOpen {
        left: 12px;
        top: 12px;
    }
}

/* ───────── shareable overlay/modal component (callable from any page) ───────── */
@keyframes ov-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.ov {
    position: fixed;
    inset: 0;
    z-index: 3500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 16, 0.6);
}
.ov.open {
    display: flex;
}
.ov-sheet {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    max-height: 90dvh; /* dvh tracks the REAL visible viewport (tablet/phone browser chrome) so the sheet never runs off-screen */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    animation: ov-pop 0.16s ease;
}
.ov-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.ov-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}
.ov-x {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-hint);
    cursor: pointer;
}
.ov-x:hover {
    background: var(--surface-2);
    color: var(--text-body);
}
.ov-body {
    flex: 1;
    min-height: 0; /* let the body actually shrink + scroll inside the capped sheet, so the footer buttons are never clipped (tablet portrait/landscape) */
    padding: 20px;
    overflow-y: auto;
}
.ov-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.ov-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-hint);
}
.ov-field i {
    color: var(--bad);
    font-style: normal;
}
.ov-hint {
    margin-top: 14px;
    font-size: var(--fs-hint);
    color: var(--text-hint);
}
.ov-err {
    margin-top: 10px;
    color: var(--bad);
    font-size: var(--fs-hint);
    font-weight: 600;
    min-height: 1rem;
}
.ov-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}
.ov-result {
    text-align: center;
    padding: 28px 20px;
}
.ov-ehub {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ok-bright);
    font-family: var(--mono);
}
.ov-result-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-top: 6px;
}
@media (max-width: 560px) {
    .ov-grid {
        grid-template-columns: 1fr;
    }
}
.ov-wide {
    max-width: 640px;
}
/* full-screen overlays on phones (field officers fill assessments on mobile) */
@media (max-width: 640px) {
    .ov {
        padding: 0;
    }
    .ov-sheet {
        max-width: none;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
    }
}
/* assessment wizard (multi-step) */
.as-steps {
    display: flex;
    gap: 6px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex: none;
}
.as-step {
    flex: none;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-hint);
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    white-space: nowrap;
}
.as-step.on {
    background: var(--brand);
    color: #fff;
}
.as-step.done {
    color: var(--ok-bright);
}
.as-geo {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}
/* new-assessment wizard: context bar, occupancy cards, method toggle, sections, live tax */
.as-ctx { font-size: var(--fs-hint); color: var(--text-hint); margin-top: 5px; line-height: 1.5; }
.as-ctx-sep { margin: 0 7px; opacity: .5; }
.as-occ { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.as-occ-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; color: var(--text-body); font: inherit; }
.as-occ-card:hover { border-color: var(--brand-bright); }
.as-occ-card.on { border-color: var(--brand); background: var(--brand-soft); }
.as-occ-ico { color: var(--brand); }
.as-occ-t { font-weight: 700; font-size: var(--fs-body); color: var(--text-heading); }
.as-occ-s { font-size: var(--fs-hint); color: var(--text-hint); }
.as-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.as-tog-btn { appearance: none; border: none; background: var(--surface); color: var(--text-hint); font: inherit; font-size: var(--fs-hint); font-weight: 600; padding: 8px 14px; cursor: pointer; }
.as-tog-btn.on { background: var(--brand); color: #fff; }
.as-h { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-subheading); margin: 18px 0 10px; }
.as-h:first-child { margin-top: 0; }
.as-chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; }
.as-chk { display: flex; align-items: center; gap: 8px; font-size: var(--fs-hint); font-weight: 600; color: var(--text-body); cursor: pointer; }
.as-chk input { width: 16px; height: 16px; accent-color: var(--brand); }
.as-live { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; }
.as-live::before { content: "Yearly tax"; font-size: var(--fs-hint); color: var(--text-hint); }
.as-live-tax { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
@media (max-width: 520px) { .as-occ { grid-template-columns: 1fr; } }

/* profile-detail overlay content */
.pf-id {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    font-family: var(--mono);
    margin-top: 2px;
}
.pf-head-btns {
    display: flex;
    gap: 8px;
}
.pf-section {
    margin: 18px 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-subheading);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pf-section:first-child {
    margin-top: 0;
}
.pf-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-hint);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 9px;
}
.pf-rows {
    display: flex;
    flex-direction: column;
}
.pf-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.pf-row:last-child {
    border-bottom: none;
}
.pf-row .k {
    font-size: var(--fs-hint);
    color: var(--text-hint);
}
.pf-row .v {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-heading);
    text-align: right;
    word-break: break-word;
}
.pf-standing {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ok-bright);
}
.pf-standing.owing {
    color: var(--bad);
}
.pf-standing span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-hint);
    letter-spacing: 0;
}
.pf-ro span {
    color: var(--text-hint);
}
.pf-ro .input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--surface-2);
}
/* full-screen overlay variant (Profile detail) */
@keyframes ov-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.ov-full {
    left: var(--nav-gap);
    padding: 0;
    /* opaque (not the translucent .ov dim) so opening covers the page instantly — otherwise the
       orange header button flashes through during the sheet's fade-in ("orange blink"). */
    background: var(--surface);
    transition: left 0.26s ease;
} /* fill the content area, keep the sidebar visible */
.ov-full .ov-sheet {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    animation: ov-fade 0.18s ease;
}
.ov-full .ov-head {
    padding: 18px 28px;
}
.ov-full .ov-body {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 26px 28px 56px;
}
.ov-full .ov-foot {
    padding: 16px 28px;
}

/* resident.html — the shared resident detail rendered as a STANDALONE page (not an overlay).
   Reuses the global .ov-* / .pf-* styles; here we just center the column and add a back link. */
.rp {
    /* clear the fixed sidebar (like #routeView) and span the full width; the column below re-centers */
    max-width: none;
    margin: 0;
    padding-top: 14px;
    padding-left: calc(var(--nav-gap) + 12px);
    transition: padding-left 0.26s ease;
}
@media (max-width: 640px) {
    .rp { padding-left: 14px; padding-right: 14px; }
}
#routeView .rp { padding: 0; max-width: none; } /* in-shell page mode: the route view owns the gutters; the profile fills the lane like every other page */
.rp .ov-head,
.rp .ov-body,
.rp .ov-foot,
.rp-back {
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}
.rp-back {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 16px 20px 0;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-hint);
    text-decoration: none;
}
.rp-back:hover {
    color: var(--text-body);
}
.pf-rows.cols2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
}
@media (max-width: 640px) {
    .pf-rows.cols2 {
        grid-template-columns: 1fr;
    }
}
.pf-props {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pf-prop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.pf-prop-addr {
    font-weight: 600;
    color: var(--text-heading);
}
.pf-prop-sub {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    margin-top: 1px;
}
.pf-prop-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}
.pf-prop-bal {
    font-weight: 700;
    color: var(--text-heading);
}
.pf-prop-bal.owing {
    color: var(--bad);
}

/* ---- Settings page (tabbed shell) ---------------------------------------- */
.set-page {
    padding: 0 28px 64px;
    max-width: 1120px;
} /* top spacing comes from #routeView */
.set-head h1 {
    font-size: var(--fs-h1);
    font-weight: var(--fw-heading);
    color: var(--text-heading);
    margin: 0;
}
.set-head .hint {
    margin-top: 4px;
}
.set-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 6px;
    border-bottom: 1px solid var(--border);
}
.set-tab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font: inherit;
    font-size: var(--fs-body);
    font-weight: var(--fw-subheading);
    color: var(--text-hint);
    cursor: pointer;
    margin-bottom: -1px;
}
.set-tab:hover {
    color: var(--text-body);
}
.set-tab.on {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.set-body {
    padding-top: 20px;
}
.set-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
/* Places admin (Settings > Places) — manage Town / Zone / Street */
.pl-admin .pl-sec {
    margin-top: 18px;
}
.pl-sec-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pl-sec-head h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
}
.pl-sec-head .pl-search {
    margin-left: auto;
    max-width: 220px;
    height: 32px;
}
.pl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.pl-table th,
.pl-table td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.pl-table thead th {
    font-size: var(--fs-hint);
    font-weight: 700;
    color: var(--text-hint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pl-table tbody tr:hover {
    background: var(--surface-2);
}
.pl-table td:first-child {
    font-weight: 600;
    color: var(--text-body);
    white-space: normal;
}
.pl-table .pl-r {
    text-align: right;
    width: 1%;
}
.pl-acts {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.pl-empty {
    color: var(--text-hint);
    text-align: center;
    padding: 18px;
}
.pl-err {
    color: var(--bad);
    font-weight: 600;
}
@media (max-width: 640px) {
    .pl-sec-head .pl-search {
        max-width: none;
    }
}
.coming-soon code,
.perm-key code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--text-body);
}

/* ---- Permissions & Roles matrix ------------------------------------------ */
.perm-intro {
    max-width: 760px;
    margin: 0 0 16px;
}
.perm-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 22px;
    align-items: start;
}
.perm-roles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}
.perm-roles-h {
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-hint);
    padding: 2px 6px 6px;
}
.perm-role {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    appearance: none;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font: inherit;
    font-size: var(--fs-body);
    font-weight: var(--fw-subheading);
    color: var(--text-body);
    cursor: pointer;
}
.perm-role:hover {
    background: var(--surface-2);
}
.perm-role.on {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-deep);
}
.perm-tag {
    font-size: var(--fs-small);
    font-weight: 700;
    color: var(--text-hint);
    background: var(--surface-3);
    border-radius: 999px;
    padding: 1px 8px;
}
.perm-add {
    margin-top: 6px;
    appearance: none;
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font: inherit;
    font-size: var(--fs-body);
    font-weight: var(--fw-subheading);
    color: var(--text-hint);
    cursor: pointer;
}
.perm-add:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.perm-main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    min-width: 0;
}
.perm-main-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}
.perm-rolename {
    font-size: var(--fs-h3);
    font-weight: var(--fw-heading);
    max-width: 340px;
}
.perm-rolename:disabled {
    opacity: 0.7;
    cursor: default;
}
.perm-key {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    margin-top: 6px;
}
.perm-del {
    flex: none;
    color: var(--bad);
    border-color: var(--border);
}
.perm-del:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--bad);
}
.perm-note {
    margin: 4px 0 0;
}

.perm-grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}
.perm-grid th,
.perm-grid td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.perm-grid th:not(.perm-pg) {
    width: 84px;
}
.perm-grid thead th {
    font-size: var(--fs-hint);
    font-weight: 700;
    color: var(--text-hint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.perm-grid th.perm-pg,
.perm-grid td.perm-pg {
    text-align: left;
    font-weight: var(--fw-subheading);
    color: var(--text-body);
    white-space: nowrap;
}
.perm-grid tbody tr:hover {
    background: var(--surface-2);
}
/* section rows (Pages / Reports / Settings / Capabilities) and a page whose View is off */
.perm-grid .perm-sec td {
    padding: 14px 8px 5px;
    text-align: left;
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-hint);
    border-bottom: 1px solid var(--border);
    background: none;
}
.perm-grid tbody tr.is-off .perm-pg {
    color: var(--text-hint);
}
.perm-grid .sw {
    vertical-align: middle;
}
.perm-grid .perm-solo {
    text-align: left;
    padding-left: 12px;
}
.perm-solo-lbl {
    margin-left: 10px;
    font-size: var(--fs-hint);
    color: var(--text-hint);
    vertical-align: middle;
}

/* ── .sw — the switch. <label class="sw"><input type="checkbox"><span class="sw-track"></span></label> ──
   Replaces bare checkboxes wherever a setting is on/off (the permission grid, access rules). */
.sw {
    position: relative;
    display: inline-flex;
    flex: none;
    width: 36px;
    height: 20px;
    cursor: pointer;
}
.sw input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.sw-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    transition: background 0.15s, border-color 0.15s;
}
.sw-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}
.sw input:checked + .sw-track {
    background: var(--brand);
    border-color: var(--brand);
}
.sw input:checked + .sw-track::after {
    transform: translateX(16px);
}
.sw input:focus-visible + .sw-track {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
}
.sw input:disabled {
    cursor: not-allowed;
}
.sw input:disabled + .sw-track {
    opacity: 0.4;
}

.perm-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 20px;
}
.perm-status {
    font-size: var(--fs-hint);
    font-weight: var(--fw-subheading);
}
.perm-status.ok {
    color: var(--ok);
}
.perm-status.bad {
    color: var(--bad);
}
@media (max-width: 760px) {
    .perm-layout {
        grid-template-columns: 1fr;
    }
    .perm-roles {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .perm-roles-h {
        width: 100%;
    }
}

/* ---- Accounts tab (staff.js) — pills filter by role, a search, one flat zebra table, a ⋯ menu per row ---- */
.acc-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.acc-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.acc-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font: inherit;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
}
.acc-pill b {
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--surface-3);
    font-size: var(--fs-small);
    font-weight: 700;
    color: var(--text-hint);
    text-align: center;
}
.acc-pill:hover {
    border-color: var(--text-hint);
}
.acc-pill.on {
    background: var(--text-heading);
    border-color: var(--text-heading);
    color: var(--surface);
}
.acc-pill.on b {
    background: color-mix(in srgb, var(--surface) 22%, transparent);
    color: var(--surface);
}
.acc-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.acc-tools .btn {
    height: 36px;
    padding: 0 14px 0 11px;
}
.acc-search {
    position: relative;
    display: block;
}
.acc-search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-hint);
    pointer-events: none;
}
.acc-search .input {
    width: 220px;
    height: 36px;
    padding: 0 12px 0 33px;
    font-size: var(--fs-hint);
}
.acc-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto; /* a very long email scrolls the table rather than clipping the ⋯ column */
}
.acc-table {
    width: 100%;
    border-collapse: collapse;
}
.acc-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-hint);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.acc-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-body);
    color: var(--text-body);
    vertical-align: middle;
}
.acc-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}
.acc-table tbody tr:hover td {
    background: var(--surface-2);
}
.acc-table tbody tr:last-child td {
    border-bottom: none;
}
.acc-table tbody tr.is-off .acc-id,
.acc-table tbody tr.is-off .acc-avatar {
    opacity: 0.55;
}
.acc-who {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}
.acc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-subheading);
    font-size: 0.8rem;
    font-weight: 700;
}
.acc-id {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}
.acc-id b {
    font-weight: 600;
    color: var(--text-heading);
}
.acc-id small {
    max-width: 240px;
    font-size: var(--fs-hint);
    color: var(--text-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acc-role {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-3);
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-subheading);
    white-space: nowrap;
}
.acc-role.none {
    border-style: dashed;
    background: transparent;
    color: var(--text-hint);
    font-weight: 500;
}
.acc-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-hint);
    white-space: nowrap;
}
.acc-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-hint);
    opacity: 0.45;
}
.acc-status.on {
    color: var(--text-body);
}
.acc-status.on::before {
    background: var(--ok-bright);
    opacity: 1;
}
.acc-when {
    display: inline-flex;
    flex-direction: column;
    font-size: var(--fs-hint);
    line-height: 1.3;
    color: var(--text-body);
    white-space: nowrap;
}
.acc-when small {
    color: var(--text-hint);
}
.acc-when.none,
.acc-dev .none {
    color: var(--text-hint);
}
.acc-dev {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    white-space: nowrap;
}
.acc-dev span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.acc-act {
    width: 1%;
    text-align: right;
}
.acc-more {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    cursor: pointer;
}
.acc-more:hover,
.acc-more.open {
    background: var(--surface-3);
    border-color: var(--border);
    color: var(--text-heading);
}
.acc-empty {
    padding: 28px 14px;
    text-align: center;
    color: var(--text-hint);
}
@media (max-width: 760px) {
    .acc-table th:nth-child(5),
    .acc-table td:nth-child(5) {
        display: none;
    }
    .acc-search .input {
        width: 160px;
    }
    .acc-id small {
        max-width: 150px;
    }
    .acc-table th,
    .acc-table td {
        padding-left: 10px;
        padding-right: 10px;
    }
}
@media (max-width: 560px) {
    .acc-table th:nth-child(4),
    .acc-table td:nth-child(4) {
        display: none;
    }
}

/* ── .menu — the anchored popover menu (EHubMenu, staff.js): a ⋯ button's actions ── */
.menu {
    position: fixed;
    z-index: 4000;
    min-width: 196px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    animation: ov-pop 0.12s ease;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    font: inherit;
    font-size: var(--fs-hint);
    font-weight: 500;
    color: var(--text-body);
    text-align: left;
    cursor: pointer;
}
.menu-item svg {
    flex: none;
    color: var(--text-hint);
}
.menu-item:hover,
.menu-item:focus-visible {
    background: var(--surface-2);
    color: var(--text-heading);
    outline: none;
}
.menu-item.danger,
.menu-item.danger svg {
    color: var(--bad);
}
.menu-item.danger:hover {
    background: color-mix(in srgb, var(--bad) 10%, transparent);
}
.menu-sep {
    height: 1px;
    margin: 5px 4px;
    background: var(--border);
}

/* ---- Access control tab (settings-access.js) — a card per role, a switch per rule ---- */
.ac-wrap { display: flex; flex-direction: column; gap: 14px; }
.ac-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 4px 18px 8px;
    box-shadow: var(--shadow-sm);
}
.ac-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 6px; border-bottom: 1px solid var(--border); }
.ac-card h3 { font-size: 1rem; margin: 0; color: var(--text-heading); }
.ac-card-sum { font-size: var(--fs-hint); color: var(--text-hint); white-space: nowrap; }
.ac-rule { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.ac-rule + .ac-rule { border-top: 1px solid var(--border); }
.ac-rule-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-rule-t b { font-weight: 600; color: var(--text-heading); }
.ac-rule-t small { font-size: var(--fs-hint); color: var(--text-hint); }
/* a rule's settings, folded out under it while it's on */
.ac-hours,
.ac-devlimit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: -4px 0 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--surface-2);
}
.ac-hours.ac-off,
.ac-devlimit.ac-off { display: none; }
.ac-devlimit-l { font-size: var(--fs-hint); color: var(--text-hint); font-weight: 600; }
.ac-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 3px; }
.ac-seg-b { border: none; background: none; border-radius: 6px; min-width: 36px; padding: 5px 12px; font: inherit; font-weight: 600; font-size: var(--fs-hint); color: var(--text-hint); cursor: pointer; }
.ac-seg-b.on { background: var(--surface); color: var(--text-heading); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.ac-seg-b:disabled { cursor: not-allowed; opacity: .6; }
.ac-times { display: flex; gap: 14px; align-items: center; }
.ac-time-l { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-hint); color: var(--text-hint); }
.ac-time { width: auto; }
.ac-days { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-day input { position: absolute; opacity: 0; pointer-events: none; }
.ac-day span {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
    user-select: none;
}
.ac-day.on span { background: var(--brand); color: #fff; border-color: var(--brand); }
.ac-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-top: 4px; }
.ac-day span { background: var(--surface); }
.btn.danger {
    color: var(--bad);
}
.btn.danger:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--bad);
}
.pw-row {
    display: flex;
    gap: 8px;
}
.pw-row .input {
    flex: 1;
}
.cred {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: left;
}
.cred span {
    font-size: var(--fs-hint);
    font-weight: 700;
    color: var(--text-hint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cred code {
    font-family: var(--mono);
    font-size: 0.95em;
    color: var(--text-heading);
    word-break: break-all;
}

/* settings views: gentler corners + a lighter, less aggressive overlay */
.set-page .perm-roles,
.set-page .perm-main {
    border-radius: 10px;
}
.set-page .perm-role,
.set-page .perm-add {
    border-radius: 8px;
}
.set-page .rt-wrap {
    border-radius: 10px;
}
.ov-soft {
    background: rgba(2, 6, 16, 0.42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
/* .ov-blur — any overlay can opt in: frosts the page behind it instead of only dimming it, so the sheet
   reads as the one thing in focus (the burial overlay uses it) */
.ov.ov-blur {
    background: rgba(2, 6, 16, 0.3);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
}
@media (prefers-color-scheme: dark) {
    .ov.ov-blur {
        background: rgba(2, 6, 16, 0.5);
    }
}
.ov-soft .cred {
    border-radius: 8px;
}
@media (min-width: 641px) {
    .ov-soft .ov-sheet {
        border-radius: 10px;
    }
}

/* ---- Settings > Property Tax (evaluation rates) -------------------------- */
.ev-intro {
    max-width: 760px;
    margin: 0 0 4px;
}
.ev-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.ev-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 16px 14px;
}
.ev-card-h {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.ev-card-h h4 {
    margin: 0;
    font-size: var(--fs-h3);
    font-weight: var(--fw-subheading);
    color: var(--text-heading);
}
.ev-card-tag {
    font-size: var(--fs-small);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    padding: 2px 9px;
    border: 1px solid var(--border);
    background: var(--surface-3);
}
.ev-tag-occ {
    color: var(--ok);
}
.ev-tag-vac {
    color: var(--warn);
}
.ev-formula {
    font-size: 0.98rem;
    color: var(--text-body);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.ev-rate {
    color: var(--brand);
    font-weight: 800;
    white-space: nowrap;
}
.ev-eg {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 12px;
}
.ev-eg-in {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: var(--fs-hint);
    color: var(--text-hint);
}
.ev-eg-field {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.ev-eg-field i {
    position: absolute;
    left: 10px;
    font-style: normal;
    color: var(--text-hint);
}
.ev-eg-field input {
    width: 120px;
    padding-left: 22px;
}
.ev-eg-eq {
    color: var(--text-hint);
    font-weight: 700;
    padding-bottom: 9px;
}
.ev-eg-out {
    margin-left: auto;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-heading);
    padding-bottom: 6px;
}
.ev-eg-note {
    margin: 9px 0 0;
}
.ev-rates {
    margin-top: 2px;
}
.ev-rate-row {
    display: grid;
    grid-template-columns: 1fr 240px auto;
    gap: 18px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.ev-rate-row:last-child {
    border-bottom: none;
}
.ev-rate-meta label {
    font-size: var(--fs-body);
    font-weight: var(--fw-subheading);
    color: var(--text-heading);
}
.ev-rate-meta .hint {
    margin-top: 3px;
}
.ev-ref {
    font-size: var(--fs-small);
    color: var(--text-hint);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 4px;
    white-space: nowrap;
}
.ev-slider {
    width: 100%;
    height: 4px;
    cursor: pointer;
    accent-color: var(--brand);
}
.ev-slider:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.ev-num-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.ev-num {
    width: 86px;
    text-align: right;
}
.ev-unit {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    min-width: 46px;
}
.ev-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.ev-foot-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ev-foot-btns {
    display: flex;
    gap: 10px;
}
@media (max-width: 720px) {
    .ev-cards {
        grid-template-columns: 1fr;
    }
    .ev-rate-row {
        grid-template-columns: 1fr auto;
    }
    .ev-rate-meta {
        grid-column: 1 / -1;
    }
}

/* ---- global header (top bar; shown per-page via body.has-header) --------- */
body.has-header #topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px;
    flex: none;
    padding: 0 24px 0 calc(var(--nav-gap) + 24px);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.26s ease;
}
.gh-title {
    flex: none;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.gh-title h1 {
    font-size: var(--fs-h3);
    font-weight: var(--fw-heading);
    color: var(--text-heading);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gh-sub {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
/* in the parcels LIST view the global header provides search, so hide the floating map search */
body.view-list .map-search {
    display: none;
}
/* page controls hosted IN the header (e.g. the Residents table search / filter / group) */
.gh-controls {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: none;
    margin: 0;
}
/* a page that owns its controls cluster renders an empty title — drop its slot entirely */
.gh-title:has(> h1:empty) { display: none; }
.gh-controls .btn svg { vertical-align: -2px; margin-right: 5px; }
.gh-flex-sp { flex: 1; }
.gh-controls .badge { flex: none; }
.gh-ico-danger:hover { background: var(--bad) !important; color: #fff !important; border-color: var(--bad) !important; }
.gh-doc-title { flex: none; font-weight: 800; font-size: 1.05rem; color: var(--text-heading); letter-spacing: -0.01em; white-space: nowrap; }
/* "plan active" pill + the actions menu on the invoice header */
.gh-plan-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-hint); font-size: 0.72rem; font-weight: 700; }
.gh-plan-chip svg { width: 12px; height: 12px; }
.gh-controls .rt-pop { position: relative; flex: none; }
.gh-opt-danger { color: var(--bad) !important; }
.gh-opt-danger:hover { background: color-mix(in srgb, var(--bad) 10%, var(--surface)) !important; }
.gh-controls .input {
    height: 38px;
}
.gh-tool-search {
    flex: 1;
    min-width: 0;
}
.gh-tool-filter {
    width: 150px;
    flex: none;
}
.gh-tool-group {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--fs-hint);
    font-weight: 600;
    color: var(--text-hint);
    white-space: nowrap;
    flex: none;
}
.gh-tool-group .input {
    width: auto;
}
.gh-count {
    font-size: var(--fs-hint);
    color: var(--text-hint);
    white-space: nowrap;
    flex: none;
}
@media (max-width: 760px) {
    .gh-tool-filter,
    .gh-tool-group,
    .gh-count {
        display: none;
    }
}
.gh-spacer {
    flex: 1;
}
.gh-search {
    position: relative;
    display: flex;
    align-items: center;
}
.gh-search-in {
    width: 0;
    min-width: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    height: 40px;
    background: var(--field-bg);
    color: var(--text-body);
    font: inherit;
    font-size: var(--fs-body);
    opacity: 0;
    transition:
        width 0.25s ease,
        opacity 0.18s ease,
        padding 0.25s ease;
}
.gh-search.open .gh-search-in {
    width: 280px;
    opacity: 1;
    padding: 0 14px;
    border-color: var(--border);
    margin-right: 8px;
}
.gh-search-in:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.gh-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-subheading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: none;
}
.gh-search-btn:hover {
    background: var(--surface-2);
}
.gh-results {
    position: absolute;
    top: 50px;
    right: 0;
    width: 340px;
    max-width: 80vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 20;
}
.gh-rgroup {
    font-size: var(--fs-small);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-hint);
    padding: 9px 14px 4px;
}
.gh-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
}
.gh-result:hover {
    background: var(--surface-2);
}
.gh-result .r-ico {
    color: var(--text-hint);
    display: flex;
    flex: none;
}
.gh-result .r-t {
    min-width: 0;
}
.gh-result .r-title {
    display: block;
    font-weight: var(--fw-subheading);
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gh-result .r-sub {
    display: block;
    font-size: var(--fs-hint);
    color: var(--text-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gh-empty {
    padding: 16px 14px;
    color: var(--text-hint);
    font-size: var(--fs-hint);
    text-align: center;
}
.gh-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.gh-act {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
@media (max-width: 720px) {
    .gh-title h1 {
        font-size: var(--fs-body);
    }
}
@media (max-width: 560px) {
    .gh-search.open .gh-search-in {
        width: 170px;
    }
}
@media (max-width: 520px) {
    /* keep the page title (e.g. the invoice number) — just smaller; it's the context anchor */
    .gh-title h1 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 40vw;
    }
    .gh-sub {
        display: none;
    }
    .gh-act span {
        display: none;
    }
}
.res-sub {
    margin: 0 0 14px;
}

/* mobile header: page controls (e.g. the invoice actions) become their OWN BAR directly
   under the header band — full width, horizontally scrollable, nothing ever spills out */
@media (max-width: 760px) {
    body.has-header #topbar {
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        row-gap: 0;
        gap: 10px;
        padding: 4px 14px 4px 58px; /* left clears the floating menu button */
        background: color-mix(in srgb, var(--surface) 88%, transparent);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    /* header controls shrink to app-bar scale */
    .gh-search-btn { width: 36px; height: 36px; border-radius: 9px; }
    .gh-actions { gap: 7px; }
    /* the floating menu button drops into the bar's row like a native leading icon */
    body.has-header #navOpen { width: 38px; height: 38px; left: 10px; top: 5px; border-radius: 9px; box-shadow: none; }
    /* iOS-style single nav bar: the page controls live INLINE in the top bar — back + number
       pinned left, the actions pinned right (gh-flex-sp restored to push them) — no wasted
       second row, no floating centered cluster */
    .gh-controls {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        overflow: visible; /* the ⋯ menu must escape this row */
    }
    .gh-controls:empty { display: none; } /* pages without controls keep the slim single-row header */
    .gh-controls .gh-flex-sp { display: block; flex: 1 1 auto; min-width: 8px; } /* override the global mobile hide — this is what right-aligns the actions */
    .gh-controls .gh-doc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .gh-controls .btn { white-space: nowrap; flex: none; }
    .gh-controls .zd-ico-btn { flex: none; }
    .gh-controls .rt-pop-panel { top: 40px; right: 0; z-index: 260; } /* above the sticky header */
    .gh-controls .gh-pay-label { margin-left: 5px; }
    /* a detail screen with its own actions drops the global search (iOS: contextual
       bar wins over global chrome) so the single row has room */
    #topbar:has(.gh-controls) .gh-actions { display: none; }
    .gh-flex-sp { display: none; } /* the row centers as a group — no push-apart */
    .gh-actions { margin-left: auto; } /* row 1: title pinned left, search pinned right */
    .gh-title { flex: 0 1 auto; min-width: 0; }
    /* these pages carry their OWN full-width list search in the toolbar — drop the duplicate
       header magnifier on mobile so there's a single, top-of-page search */
    body[data-page="invoices"] .gh-search,
    body[data-page="residents"] .gh-search,
    body[data-page="parcels"].view-list .gh-search { display: none; }
    /* invoice actions: keep ONE primary (Record payment) + ⋯ on mobile; Edit/Print fold into the menu */
    .gh-controls .gh-only-desk { display: none; }
}
/* the menu duplicates of Edit/Print only exist on mobile (icons cover them on desktop) */
.gh-controls .gh-only-mob { display: none; }
@media (max-width: 760px) { .gh-controls .gh-only-mob { display: flex; } }
/* smallest phones: the primary action goes icon-only so the single nav row never overflows */
@media (max-width: 360px) { .gh-controls .gh-pay-label { display: none; } .gh-controls .gh-pay-label { margin: 0; } }

/* ───────────────────────── Invoices: list page + the central document ───────────────────────── */
.inv-detail-page{max-width:1240px;margin:0} /* left-aligned: the paper's corner lines up with the header's back arrow */
/* drill-in navigation: opening a document pushes in from the right; going back eases in from the left */
.page-in{animation:pageIn .34s cubic-bezier(.22,1,.36,1) both}
@keyframes pageIn{from{opacity:0;transform:translateX(min(9vw,72px))}to{opacity:1;transform:none}}
.page-back{animation:pageBack .28s cubic-bezier(.22,1,.36,1) both}
@keyframes pageBack{from{opacity:0;transform:translateX(max(-7vw,-48px))}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.page-in,.page-back{animation:none}}
.inv-back{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.inv-back .btn svg{vertical-align:-3px;margin-right:4px}
.inv-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:240px;color:var(--text-hint);border:1px dashed var(--border);border-radius:var(--radius)}
.inv-pad{padding:14px}

/* the document */
/* invoice LEFT, activity log RIGHT — use the whole page width */
.inv-doc{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}
.inv-actions{grid-column:1 / -1;display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:0}
.inv-paper{grid-column:1}
.inv-actions-spacer{flex:1}
.inv-actions .btn svg{vertical-align:-2px;margin-right:5px}
.inv-paper{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:32px 36px}
.inv-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding-bottom:18px;border-bottom:2px solid var(--text-heading)}
.inv-brand{display:flex;gap:12px;align-items:center}
.inv-brand-logo{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--brand),var(--brand-bright));color:#fff}
.inv-brand-name{font-weight:800;font-size:1.02rem;color:var(--text-heading);letter-spacing:-.01em}
.inv-brand-sub{font-size:.74rem;color:var(--text-hint);margin-top:1px}
.inv-title-block{text-align:right}
.inv-title{font-size:1.55rem;font-weight:800;letter-spacing:.12em;color:var(--text-heading);line-height:1}
.inv-number{font-size:.85rem;font-weight:600;color:var(--text-hint);margin:4px 0 6px;font-variant-numeric:tabular-nums}
.inv-meta{display:grid;grid-template-columns:1fr 280px;gap:24px;padding:18px 0;border-bottom:1px solid var(--border)}
.inv-label{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-hint);margin-bottom:6px}
.inv-billto-name{font-weight:700;font-size:.95rem;color:var(--text-heading)}
/* linked owner: the NAME reads as a real link — accent color + underline, plain when printed */
.inv-billto-link{display:block;background:none;border:none;padding:0;text-align:left;cursor:pointer;font-family:inherit;color:var(--brand);text-decoration:underline;text-decoration-color:color-mix(in srgb, var(--brand) 45%, transparent);text-underline-offset:3px}
.inv-billto-link:hover{text-decoration-color:var(--brand);filter:brightness(1.08)}
/* unlinked owner: a dashed "to do" chip invites the link (edit-gated; never printed) */
.inv-link-owner{display:inline-flex;align-items:center;gap:6px;margin-top:6px;padding:3px 10px;border-radius:999px;border:1px dashed var(--border);background:none;color:var(--text-hint);font-size:.72rem;font-weight:600;cursor:pointer;font-family:inherit}
.inv-link-owner:hover{border-color:var(--brand);color:var(--brand)}
@media print{.inv-billto-link{color:var(--text-heading);text-decoration:none}.inv-link-owner{display:none}}
.inv-billto-line{font-size:.8rem;color:var(--text-body);margin-top:2px}
.inv-billto .zd-link-btn{margin-top:6px}
.inv-parcels{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.inv-property{margin-top:10px}
.inv-prop-txt{font-weight:600;color:var(--text-heading);font-size:.85rem}
.inv-unlinked{margin-top:4px;font-size:.8rem;color:var(--brand);font-style:italic}
.inv-chip-link{padding:3px 10px;border-radius:999px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-body);font-size:.72rem;font-weight:600;cursor:pointer}
.inv-chip-link:hover{border-color:var(--brand);color:var(--brand)}
.inv-kv{display:flex;justify-content:space-between;gap:14px;font-size:.8rem;padding:3px 0}
.inv-kv span{color:var(--text-hint)}
.inv-kv b{color:var(--text-heading);font-weight:600;text-align:right}
.inv-items{width:100%;border-collapse:collapse;margin:6px 0 4px}
.inv-items th{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-hint);text-align:left;padding:12px 10px 8px;border-bottom:1px solid var(--border)}
.inv-items td{font-size:.84rem;color:var(--text-body);padding:10px;border-bottom:1px solid var(--border)}
.inv-items td:first-child{color:var(--text-heading);font-weight:500}
.inv-totals{margin-left:auto;width:300px;padding:12px 10px 0}
.inv-totals .inv-due{border-top:2px solid var(--text-heading);margin-top:8px;padding-top:10px}
.inv-totals .inv-due span{font-weight:700;color:var(--text-heading)}
.inv-totals .inv-due b{font-size:1.2rem;font-weight:800}
.inv-due .fb-owing{color:var(--bad)}
.inv-due .fb-clear{color:var(--ok)}
.inv-footnote{margin-top:22px;padding-top:14px;border-top:1px solid var(--border);font-size:.72rem;color:var(--text-hint)}
.inv-side{grid-column:2;position:sticky;top:16px;display:flex;flex-direction:column;gap:14px;max-height:calc(100vh - 120px);min-height:0}
.inv-activity{margin-top:0;display:flex;flex-direction:column;flex:1;min-height:0}
.inv-activity .zd-timeline{overflow-y:auto}
/* payment plan card (invoice side column) */
.inv-plan-sum{font-size:.82rem;color:var(--text-body);margin-bottom:8px}
.inv-plan-bar{margin-bottom:10px}
.inv-plan-rows{display:flex;flex-direction:column;max-height:220px;overflow-y:auto}
.inv-plan-row{display:flex;align-items:center;gap:8px;padding:5px 2px;border-bottom:1px solid var(--border);font-size:.76rem;color:var(--text-body)}
.inv-plan-row:last-child{border-bottom:none}
.inv-plan-row.paid{opacity:.55}
.inv-plan-row.next{background:var(--surface-2);border-radius:6px}
.inv-plan-n{flex:0 0 18px;text-align:right;color:var(--text-hint);font-weight:600}
.inv-plan-due{flex:1}
.inv-plan-amt{font-variant-numeric:tabular-nums;font-weight:600;color:var(--text-heading)}
.inv-plan-state{flex:0 0 52px;text-align:right;font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-hint)}
.inv-plan-row.next .inv-plan-state{color:var(--brand)}
.inv-plan-row.overdue .inv-plan-state{color:var(--bad)}
@media (max-width:980px){.inv-doc{grid-template-columns:1fr}.inv-paper{grid-column:auto}.inv-side{grid-column:auto;position:static;max-height:none}}
@media (max-width:640px){.inv-paper{padding:22px 18px}.inv-meta{grid-template-columns:1fr;gap:16px}}

/* print: only the cloned paper in #invPrintHost is visible */
#invPrintHost{display:none}
@media print{
  @page{margin:12mm}
  body.inv-printing{background:#fff}
  body.inv-printing > :not(#invPrintHost){display:none !important}
  /* static flow, full width — absolute positioning is what clipped the right half */
  body.inv-printing #invPrintHost{display:block;position:static;width:100%}
  body.inv-printing #invPrintHost .inv-paper{border:none;box-shadow:none;border-radius:0;max-width:none;width:100%;padding:0}
  body.inv-printing #invPrintHost .inv-meta{grid-template-columns:1fr 230px}
}

/* ── resident detail: modern layout (hero, facts, owing banner, clickable rows, fade-in) ── */
.pf-hero{display:flex;align-items:center;gap:13px;min-width:0}
.pf-avatar{flex:none;width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-bright));color:#fff;font-weight:800;font-size:1rem;letter-spacing:.02em}
.pf-hero-t{min-width:0}
.pf-hero-t h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pf-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:14px;overflow:hidden}
.pf-fact{padding:12px 14px;border-right:1px solid var(--border)}
.pf-fact:last-child{border-right:none}
.pf-fact .v{font-size:1.05rem;font-weight:800;color:var(--text-heading);font-variant-numeric:tabular-nums}
.pf-fact .v.owing{color:var(--bad)}
.pf-fact .v.clear{color:var(--ok)}
.pf-fact .k{font-size:.68rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--text-hint);margin-top:2px}
.pf-owe{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;cursor:pointer;
  padding:11px 14px;border-radius:var(--radius);border:1px solid var(--bad);
  background:color-mix(in srgb, var(--bad) 6%, var(--surface));margin-bottom:14px}
.pf-owe:hover{background:color-mix(in srgb, var(--bad) 11%, var(--surface))}
.pf-owe-main{color:var(--text-body);font-size:.86rem}
.pf-owe-main b{color:var(--bad)}
.pf-owe-go{flex:none;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--bad)}
.pf-prop.pf-click{cursor:pointer}
.pf-prop.pf-click:hover{background:var(--surface-2)}
/* staggered fade-in for the detail sections */
@keyframes pf-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.pf-anim>*{animation:pf-in .32s ease backwards}
.pf-anim>*:nth-child(1){animation-delay:.03s}
.pf-anim>*:nth-child(2){animation-delay:.07s}
.pf-anim>*:nth-child(3){animation-delay:.11s}
.pf-anim>*:nth-child(4){animation-delay:.15s}
.pf-anim>*:nth-child(5){animation-delay:.19s}
.pf-anim>*:nth-child(6){animation-delay:.23s}
.pf-anim>*:nth-child(7){animation-delay:.27s}
.pf-anim>*:nth-child(8){animation-delay:.31s}
.pf-anim>*:nth-child(n+9){animation-delay:.35s}
@media (prefers-reduced-motion:reduce){.pf-anim>*{animation:none}}

/* ============ Resident detail — full-width, tabbed, premium ============ */
.rd{display:flex;flex-direction:column;min-height:0}
.ov-sheet .rd{height:100%}
.rd-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px 32px;border-bottom:1px solid var(--border);background:var(--surface)}
.rd-hero-id{display:flex;align-items:center;gap:16px;min-width:0}
.rd-avatar{flex:none;width:54px;height:54px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.2rem;color:#fff;background:linear-gradient(135deg,var(--brand),var(--brand-deep,#b45309));box-shadow:0 8px 22px -10px var(--brand)}
.rd-hero-t{min-width:0}
.rd-hero-t h2{font-size:1.5rem;font-weight:800;color:var(--text-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.12}
.rd-hero-sub{font-size:.85rem;color:var(--text-hint);margin-top:3px;font-variant-numeric:tabular-nums}
.rd-hero-r{display:flex;align-items:center;gap:12px;flex:none}
.rd-owe{display:flex;flex-direction:column;align-items:flex-end;padding:6px 16px;border-radius:12px;border:1px solid var(--border);background:var(--surface-2)}
.rd-owe.owing{border-color:color-mix(in srgb,var(--bad) 40%,var(--border));background:color-mix(in srgb,var(--bad) 10%,var(--surface))}
.rd-owe-k{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.rd-owe-v{font-size:1.3rem;font-weight:800;color:var(--text-heading);font-variant-numeric:tabular-nums;line-height:1.12}
.rd-owe.owing .rd-owe-v{color:var(--bad)}
.rd-iconbtn{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);background:var(--surface);color:var(--text-body);cursor:pointer;transition:background .15s,border-color .15s}
.rd-iconbtn:hover{background:var(--surface-2);border-color:var(--text-hint)}
.rd-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;padding:18px 32px 4px}
.rd-stat{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:14px 16px}
.rd-stat-v{font-size:1.5rem;font-weight:800;color:var(--text-heading);font-variant-numeric:tabular-nums;line-height:1.1}
.rd-stat-v.owing{color:var(--bad)}
.rd-stat-k{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-hint);margin-top:6px}
.rd-stat-sub{font-size:.78rem;color:var(--text-body);margin-top:2px}
.rd-tabs{display:flex;gap:2px;padding:14px 32px 0;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none}
.rd-tabs::-webkit-scrollbar{display:none}
.rd-tab{position:relative;display:inline-flex;align-items:center;gap:7px;padding:11px 14px;border:none;background:none;color:var(--text-hint);font-weight:600;font-size:.92rem;cursor:pointer;white-space:nowrap;border-bottom:2px solid transparent;margin-bottom:-1px;transition:color .15s}
.rd-tab:hover{color:var(--text-body)}
.rd-tab.on{color:var(--brand);border-bottom-color:var(--brand)}
.rd-tab-n{font-size:.72rem;font-weight:700;background:var(--surface-2);color:var(--text-hint);border-radius:999px;padding:1px 8px;min-width:20px;text-align:center}
.rd-tab.on .rd-tab-n{background:color-mix(in srgb,var(--brand) 16%,transparent);color:var(--brand)}
.rd-body{flex:1;overflow-y:auto;padding:22px 32px 44px}
.rd-pane{display:none;animation:rd-fade .26s ease}
.rd-pane.on{display:block}
@keyframes rd-fade{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.rd-pane{animation:none}}
.rd-list{display:flex;flex-direction:column;gap:8px;max-width:1080px}
.rd-item{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;text-align:left;padding:14px 18px;border:1px solid var(--border);border-radius:12px;background:var(--surface);cursor:pointer;transition:border-color .15s,background .15s,transform .06s}
.rd-item:hover{border-color:var(--text-hint);background:var(--surface-2)}
.rd-item:active{transform:scale(.997)}
.rd-item-l{min-width:0}
.rd-item-t{font-weight:700;color:var(--text-heading);display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rd-item-sub{font-size:.82rem;color:var(--text-hint);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rd-item-r{display:flex;align-items:center;gap:12px;flex:none}
.rd-item-amt{font-weight:800;color:var(--text-heading);font-variant-numeric:tabular-nums}
.rd-item-amt.owing{color:var(--bad)}
.rd-empty{padding:30px;text-align:center;color:var(--text-hint);border:1px dashed var(--border);border-radius:12px;background:var(--surface)}
.rd-grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;max-width:1080px}
.rd-card{border:1px solid var(--border);border-radius:14px;background:var(--surface);overflow:hidden}
.rd-card-h{padding:14px 18px;font-weight:800;color:var(--text-heading);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:8px}
.rd-kv{padding:4px 18px 12px}
.rd-kv-row{display:flex;justify-content:space-between;gap:18px;padding:10px 0;border-bottom:1px solid var(--border)}
.rd-kv-row:last-child{border-bottom:none}
.rd-kv-row .k{color:var(--text-hint);font-size:.86rem;flex:none}
.rd-kv-row .v{color:var(--text-body);font-weight:600;text-align:right;min-width:0;overflow-wrap:anywhere}
.rd-chip{font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-hint);background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:1px 6px}
.rd-logs{display:flex;flex-direction:column;max-width:760px;padding-left:5px}
.rd-log{display:flex;gap:14px;padding-bottom:18px;position:relative}
.rd-log:not(:last-child)::before{content:"";position:absolute;left:5px;top:14px;bottom:0;width:2px;background:var(--border)}
.rd-log-dot{flex:none;width:12px;height:12px;border-radius:50%;margin-top:3px;background:var(--text-hint);box-shadow:0 0 0 3px var(--bg);z-index:1}
.rd-log-dot.edit{background:var(--brand)}
.rd-log-dot.pay{background:var(--ok)}
.rd-log-dot.bad{background:var(--bad)}
.rd-log-c{min-width:0;padding-top:1px}
.rd-log-line{color:var(--text-body)}
.rd-log-line b{color:var(--text-heading);font-weight:700}
.rd-log-from{color:var(--text-hint);font-size:.85rem}
.rd-log-meta{font-size:.78rem;color:var(--text-hint);margin-top:2px;font-variant-numeric:tabular-nums}
@media (max-width:760px){
  .rd-hero{padding:16px 18px}
  .rd-hero-t h2{font-size:1.2rem}
  .rd-stats{padding:14px 18px 2px;grid-template-columns:1fr 1fr}
  .rd-tabs{padding:12px 18px 0}
  .rd-body{padding:18px 18px 34px}
}

/* ============ Shared activity-log overlay (EHubLog) ============ */
.lg-sheet{max-width:520px}
.lg-head-t{display:flex;align-items:center;gap:10px;min-width:0}
.lg-head-t h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lg-dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--text-hint)}
.lg-dot.ok{background:var(--ok)}
.lg-dot.bad{background:var(--bad)}
.lg-dot.edit{background:var(--brand)}
.lg-meta{display:flex;flex-direction:column;gap:1px;border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-bottom:16px}
.lg-meta-row{display:flex;gap:14px;padding:11px 14px;background:var(--surface)}
.lg-meta-row+.lg-meta-row{border-top:1px solid var(--border)}
.lg-meta-row .k{flex:none;width:54px;font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-hint)}
.lg-meta-row .v{color:var(--text-body);font-weight:600;min-width:0;overflow-wrap:anywhere}
.lg-geo{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.lg-geo svg{flex:none;color:var(--text-hint)}
.lg-ip{font-size:.74rem;color:var(--text-hint);font-weight:500;margin-left:4px}
.lg-maplink{color:var(--brand);font-weight:600;text-decoration:none}
.lg-maplink:hover{text-decoration:underline}
.lg-sec{margin-bottom:16px}
.lg-sec-h{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-hint);margin:0 0 8px 2px}
.lg-records{display:flex;flex-direction:column;gap:8px}
.lg-record{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;padding:11px 14px;border:1px solid var(--border);border-radius:11px;background:var(--surface);cursor:pointer;color:var(--text-body);transition:border-color .15s,background .15s}
.lg-record:hover{border-color:var(--brand);background:var(--surface-2)}
.lg-record svg{flex:none;color:var(--text-hint)}
.lg-record-l{display:flex;flex-direction:column;min-width:0}
.lg-record-k{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-hint)}
.lg-record-t{font-weight:700;color:var(--text-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lg-kv{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:11px;overflow:hidden}
.lg-kv-row{display:flex;gap:14px;padding:10px 14px;background:var(--surface)}
.lg-kv-row+.lg-kv-row{border-top:1px solid var(--border)}
.lg-kv-row .k{flex:none;width:110px;color:var(--text-hint);font-size:.84rem}
.lg-kv-row .v{color:var(--text-body);min-width:0;overflow-wrap:anywhere}
.lg-code{font-family:ui-monospace,Menlo,monospace;font-size:.76rem;color:var(--text-body)}
.lg-change{font-size:.85rem}
.lg-empty{padding:16px;text-align:center;color:var(--text-hint);border:1px dashed var(--border);border-radius:11px}
.lg-edited{font-size:.78rem;color:var(--text-hint);margin:4px 2px 0}
.lg-foot{display:flex;align-items:center}
.lg-foot-sp{flex:1}
.lg-del{color:var(--bad)}
.lg-form{display:flex;flex-direction:column;gap:12px}
.lg-field{display:flex;flex-direction:column;gap:5px}
.lg-field>span{font-size:.78rem;font-weight:600;color:var(--text-hint)}
.lg-json{font-family:ui-monospace,Menlo,monospace;font-size:.8rem;resize:vertical}
/* a log row anywhere it's shown is clickable */
.lg-clickable{cursor:pointer}

@media (max-width:560px){
  .pf-facts{grid-template-columns:1fr 1fr}
  .pf-fact:nth-child(2n){border-right:none}
  .pf-fact:nth-child(-n+2){border-bottom:1px solid var(--border)}
  .pf-owe{flex-direction:column;align-items:flex-start;gap:4px}
}

/* assessment Owner step: link-before-you-assess (the curation gate) */
.as-lk-chosen{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:16px;border:1px solid var(--ok);border-radius:var(--radius);background:color-mix(in srgb, var(--ok) 6%, var(--surface))}
.as-lk-chosen-t{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--ok)}
.as-lk-chosen-n{font-size:1.05rem;font-weight:800;color:var(--text-heading)}
.as-lk-chosen-e{font-size:.78rem;color:var(--text-hint);font-variant-numeric:tabular-nums}
.as-lk-chosen .btn{margin-top:8px}
.as-lk-newhead{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-hint);margin:16px 0 8px;padding-top:14px;border-top:1px dashed var(--border)}
.as-lk-skip{display:block;margin:14px auto 0;background:none;border:none;color:var(--text-hint);font-size:.78rem;text-decoration:underline;cursor:pointer}
.as-lk-skip:hover{color:var(--text-body)}
/* the link picker rows reuse .lk-row, which lives in map.css (assessments open on the parcels shell) */

/* shared payment / plan / receive overlay (payment-overlay.js) — a POS in TWO columns:
   LEFT  = what is being paid and who pays it: balance, payer gate, parcel link, then the bills (receive)
           or the payment log (single invoice);
   RIGHT = the payment itself: a big amount box with quick chips (the on-screen keypad was removed
           2026-10-07 — it took too much of the sheet), the method, a one-line result (change due / still owed), ref + date, folded
           extras (discount, note, receipt) — and Record pinned underneath so it never scrolls away. */
.po-sheet{max-width:980px;width:calc(100% - 32px)}
.po-sheet.po-narrow{max-width:560px} /* receive picker / loading / done: one column */
.po-sheet .ov-head{gap:14px}
.po-head-l{min-width:0}
.po-head-l h3{white-space:nowrap}
.po-head-sub{margin-top:1px;font-size:.84rem;color:var(--text-hint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.po-tabs{display:flex;gap:2px;padding:3px;background:var(--surface-2);border:1px solid var(--border);border-radius:999px;margin-left:auto}
.po-tab{border:none;background:transparent;color:var(--text-hint);font-family:var(--font);font-size:.8rem;font-weight:600;line-height:1;padding:7px 14px;border-radius:999px;cursor:pointer}
.po-tab.on{background:var(--brand);color:#fff}
.po-body{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,400px)}
.po-left{min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:18px 20px 20px;background:var(--surface-2)}
.po-right{min-height:0;display:flex;flex-direction:column;border-left:1px solid var(--border);background:var(--surface)}
.po-pad{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:18px 20px 14px}
.po-actbar{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 20px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface)}
/* the result line rides in the pinned bar, right above Record, so change due is never scrolled away */
.po-actbar .po-result{flex:1 1 100%}
.po-actbar .po-result-line{padding:8px 14px}
.po-actbar .po-result-line b{font-size:1.3rem}
.po-actbar .po-result-line.part b,.po-actbar .po-result-line.over b,.po-actbar .po-result-line.disc b{font-size:1.05rem}
.po-actbar .po-result-line.full{padding:0 2px}

/* left: balance, totals, history */
.po-bal{display:flex;flex-direction:column}
.po-bal-k{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.po-bal-v{font-size:1.9rem;font-weight:800;letter-spacing:-.01em;line-height:1.15;font-variant-numeric:tabular-nums}
.po-bal.owing .po-bal-v{color:var(--bad)}
.po-bal.clear .po-bal-v{color:var(--ok)}
.po-totals{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin-top:-6px;font-size:.78rem;color:var(--text-hint)}
.po-totals-link{margin-left:auto;color:var(--brand);font-weight:600}
.po-totals-link:hover{text-decoration:underline}
.po-log-head{margin-top:2px;padding-top:12px;border-top:1px solid var(--border);font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.po-log{flex:1;min-height:60px;overflow-y:auto;display:flex;flex-direction:column;gap:6px}
.po-log-row{display:flex;flex-direction:column}
.po-log-amt{font-weight:700;font-size:.86rem;color:var(--text-heading);font-variant-numeric:tabular-nums}
.po-log-meta{font-size:.72rem;color:var(--text-hint)}
.po-print{align-self:stretch;justify-content:center}
.po-print svg{vertical-align:-2px;margin-right:5px}

/* right: the amount box */
.po-amtbox{padding:12px 14px 12px 16px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);transition:border-color .15s,box-shadow .15s}
.po-amtbox:focus-within{border-color:var(--brand-bright);box-shadow:0 0 0 4px rgba(249,115,22,.14)}
.po-amtbox-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.po-amt-k{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.po-amt-field{display:flex;align-items:center;gap:8px;margin-top:2px}
.po-cur{flex:none;font-size:1.05rem;font-weight:700;color:var(--text-hint)}
.po-amt-input{flex:1 1 auto;min-width:0;width:100%;padding:0;border:0;outline:none;background:transparent;font-family:inherit;font-size:2.2rem;font-weight:800;line-height:1.2;letter-spacing:-.02em;color:var(--text-heading);font-variant-numeric:tabular-nums}
.po-amt-input::placeholder{color:color-mix(in srgb,var(--text-hint) 50%,transparent)}
.po-amt-clear{flex:none;display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:var(--surface-3);color:var(--text-hint);cursor:pointer}
.po-amt-clear:hover{color:var(--text-body)}
.po-amt-clear[hidden]{display:none}
.po-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.po-chip{display:inline-flex;align-items:baseline;gap:6px;min-height:34px;padding:7px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-body);font-size:.8rem;font-weight:700;cursor:pointer;touch-action:manipulation;transition:border-color .15s,color .15s}
.po-chip small{font-size:.76rem;font-weight:600;color:var(--text-hint);font-variant-numeric:tabular-nums}
.po-chip:hover{border-color:var(--brand);color:var(--brand)}


/* right: method, result, fields, folded extras, Record */
.po-seg{display:flex;gap:6px}
.po-seg-btn{flex:1;min-height:44px;padding:0 4px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text-body);font-weight:700;font-size:.84rem;cursor:pointer;touch-action:manipulation}
.po-seg-btn.on{background:var(--brand);border-color:var(--brand);color:#fff}
/* smart result line: one field tells the whole story — change (over), still owed (under), or paid in full */
.po-result{display:flex;flex-direction:column;gap:6px}
.po-result:empty{display:none}
.po-result-line{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px;border-radius:var(--radius);font-size:.7rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--text-hint)}
.po-result-line b{font-size:1.5rem;font-variant-numeric:tabular-nums;letter-spacing:0}
.po-result-line.change{background:color-mix(in srgb, var(--ok) 9%, var(--surface));border:1px solid var(--ok)}
.po-result-line.change b{color:var(--ok)}
.po-result-line.part{background:var(--surface-2);border:1px solid var(--border)}
.po-result-line.part b{color:var(--text-heading);font-size:1.15rem}
.po-result-line.over{background:color-mix(in srgb, var(--bad) 7%, var(--surface));border:1px solid color-mix(in srgb, var(--bad) 40%, var(--border))}
.po-result-line.over b{color:var(--bad);font-size:1.15rem}
.po-result-line.full{justify-content:flex-start;padding:4px 2px;text-transform:none;letter-spacing:.01em;font-weight:600;font-size:.82rem;color:var(--ok)}
.po-result-line.disc{background:color-mix(in srgb, var(--bad) 8%, var(--surface));border:1px solid color-mix(in srgb, var(--bad) 38%, var(--border))}
.po-result-line.disc b{color:var(--bad);font-size:1.15rem}
.po-mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.po-more{display:flex;flex-wrap:wrap;gap:2px 18px;margin-top:-2px}
.po-more-toggle{padding:4px 0;border:0;background:none;color:var(--brand);font-family:inherit;font-size:.84rem;font-weight:600;cursor:pointer}
.po-more-toggle:hover{text-decoration:underline}
.po-more-toggle.on{color:var(--text-hint)}
.po-fold[hidden]{display:none}
.po-file{padding:8px}
.po-pad .ov-err{margin-top:0}
.po-pad .ov-err:empty{display:none}
.po-go{flex:1 1 auto;justify-content:center;height:52px;font-size:1rem;font-weight:800}
.po-go:disabled{opacity:.55;cursor:not-allowed;filter:none}
.po-preview{font-size:.86rem;color:var(--text-body)}
.po-plan-foot .danger{flex:none;height:52px}
.po-firstpay{display:flex;align-items:center;gap:9px;font-size:.86rem;font-weight:600;color:var(--text-heading);cursor:pointer}

/* payer gate + linked chip + parcel link (left column) */
.po-gate{padding:12px;border:1px solid var(--brand);border-radius:var(--radius);background:var(--brand-soft,var(--surface-2))}
.po-gate-t{font-size:.82rem;font-weight:700;color:var(--text-heading);margin-bottom:8px}
.po-gate-t span{display:block;font-weight:500;font-size:.74rem;color:var(--text-hint);margin-top:2px}
.po-gate .lk-list{max-height:150px}
.po-linked{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--ok);border-radius:var(--radius);background:color-mix(in srgb, var(--ok) 6%, var(--surface));font-size:.84rem;color:var(--text-body)}
.po-linked b{color:var(--text-heading);flex:1}
.po-newprofile{margin-top:8px;width:100%;padding:8px;border:1px dashed var(--border);border-radius:var(--radius);background:none;color:var(--brand);font-weight:600;font-size:.82rem;cursor:pointer;transition:background .15s,border-color .15s}
.po-newprofile:hover{background:var(--surface-2);border-color:var(--brand)}
#residentFormModal{z-index:4700} /* sits above the payment sheet / link wizard when creating a profile mid-flow */
.po-roles{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.po-roles:empty{display:none}
.po-rolechip{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:7px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);cursor:pointer;text-align:left;transition:border-color .15s,background .15s}
.po-rolechip:hover{border-color:var(--brand);background:var(--surface-2)}
.po-rolechip.suggested{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 8%,var(--surface))}
.po-role-k{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-hint)}
.po-rolechip.suggested .po-role-k{color:var(--brand)}
.po-role-n{font-weight:600;color:var(--text-heading);font-size:.86rem}
.po-parcel-open{width:100%;justify-content:center}
.po-opt{font-weight:500;font-size:.7rem;color:var(--text-hint);margin-left:6px}
.po-parcel-pick{margin-top:8px;display:flex;flex-direction:column;gap:8px}
.po-parcel-pick .lk-list{max-height:150px}

/* receive: every open bill, marked with what this payment does to it */
.po-rcv-depts{display:flex;flex-wrap:wrap;gap:6px}
.po-rcv-depts span{font-size:.72rem;font-weight:600;color:var(--text-body);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:3px 9px}
.po-bills-head{display:flex;justify-content:space-between;gap:8px;margin-top:2px;padding-top:12px;border-top:1px solid var(--border);font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.po-bills{display:flex;flex-direction:column;gap:6px}
.po-bill{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);transition:border-color .15s,background .15s}
.po-bill-main{display:flex;flex-direction:column;min-width:0}
.po-bill-main b{font-size:.88rem;color:var(--text-heading)}
.po-bill-main span{font-size:.74rem;color:var(--text-hint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.po-bill-amt{display:flex;flex-direction:column;align-items:flex-end;flex:none;text-align:right;font-weight:700;color:var(--text-heading);font-variant-numeric:tabular-nums;white-space:nowrap}
.po-bill-tag{font-size:.72rem;font-weight:700}
.po-bill.is-clear{border-color:color-mix(in srgb,var(--ok) 55%,var(--border));background:color-mix(in srgb,var(--ok) 7%,var(--surface))}
.po-bill.is-clear .po-bill-tag{color:var(--ok)}
.po-bill.is-part{border-color:color-mix(in srgb,var(--warn) 60%,var(--border));background:color-mix(in srgb,var(--warn) 8%,var(--surface))}
.po-bill.is-part .po-bill-tag{color:var(--warn)}
.po-pick-list{margin-top:10px;max-height:320px;overflow:auto}
.po-pick-group{font-size:.7rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--text-hint);margin:12px 2px 4px}
.po-rcv-go{width:100%;margin-top:12px;justify-content:center;height:48px}

/* success — change is the headline (the clerk is counting bills) */
.po-done{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:26px 10px;text-align:center}
.po-done-rcv{flex:none;padding:10px 0 14px}
.po-done-amt{font-size:1.3rem;font-weight:800;color:var(--text-heading)}
.po-done-change{display:flex;flex-direction:column;gap:2px;padding:14px 30px;border-radius:var(--radius);background:color-mix(in srgb, var(--ok) 9%, var(--surface));border:1px solid var(--ok);font-size:.7rem;font-weight:800;letter-spacing:.1em;color:var(--text-hint)}
.po-done-change b{font-size:2.2rem;color:var(--ok);font-variant-numeric:tabular-nums;letter-spacing:0}
.po-done-bal{font-size:.88rem;color:var(--text-body)}
.po-done-btns{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:8px}
.po-done-list{max-height:36vh}

@media (max-width:700px){
  /* PHONE: a bottom sheet that slides up; the two columns stack and the whole body scrolls */
  .ov.po-modal{align-items:flex-end;padding:0}
  .po-modal .po-sheet{max-width:none;width:100%;max-height:94vh;max-height:94dvh;border-radius:18px 18px 0 0;animation:po-slide .28s cubic-bezier(.22,1,.36,1)}
  .po-modal .po-sheet::before{content:"";flex:none;width:36px;height:4px;border-radius:3px;background:var(--border);margin:8px auto 2px} /* grab handle */
  .po-body{display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain}
  .po-left{flex:none;overflow:visible;padding:14px 16px;border-bottom:1px solid var(--border)}
  .po-right{flex:none;border-left:0}
  .po-pad{flex:none;overflow:visible;padding:14px 16px}
  .po-actbar{position:sticky;bottom:0;z-index:2;padding:10px 16px calc(12px + env(safe-area-inset-bottom));box-shadow:0 -10px 18px -12px rgba(15,23,42,.28)}
  .po-log,.po-log-head{display:none} /* phone: history lives on the printed copy / invoice page */
  .po-bills{max-height:30vh;overflow-y:auto}
  .po-bal-v{font-size:1.6rem}
  .po-tabs{margin-left:0}
  .po-sheet .ov-head{flex-wrap:wrap}
}
@media (min-width:701px) and (max-height:760px){
  /* short screens (tablets in landscape, small laptops): tighten so amount, method, the result and Record all fit */
  .po-pad{gap:10px;padding-top:14px}
  .po-amtbox{padding:10px 12px 10px 14px}
  .po-amt-input{font-size:1.8rem}
  .po-chips{margin-top:6px}
  .po-chip{min-height:30px;padding:5px 11px}
  .po-actbar{padding-top:10px;padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  .po-actbar .po-result-line{padding:6px 12px}
  .po-actbar .po-result-line b{font-size:1.15rem}
  .po-go{height:48px}
  .po-bal-v{font-size:1.6rem}
}
@keyframes po-slide{from{transform:translateY(100%)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.po-modal .po-sheet{animation:none}}

/* invoice editor: line-item grid + inline catalog creation */
.ie-sheet{max-width:760px}
.ie-h{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint);margin:18px 0 8px}
.ie-h .hint{text-transform:none;letter-spacing:0;font-weight:500;margin-left:8px}
.ie-lines{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.ie-row{display:grid;grid-template-columns:auto 1fr 64px 92px 84px 26px;gap:6px;align-items:center} /* col 1 = the select's own fitted width */
.ie-row .input{height:34px;font-size:.82rem;padding:0 10px}
.ie-amt{text-align:right;font-weight:700;font-size:.82rem;font-variant-numeric:tabular-nums;color:var(--text-heading)}
.ie-newitem{margin-top:10px;padding:12px;border:1px dashed var(--brand);border-radius:var(--radius);background:var(--brand-soft,var(--surface-2))}
.ie-newitem-grid{display:grid;grid-template-columns:1.6fr 1fr .8fr auto;gap:8px;align-items:center}
.ie-newitem-grid .input{height:34px;font-size:.82rem;padding:0 10px}
.ie-total{margin-top:10px;padding-top:10px;border-top:1px solid var(--border);text-align:right;font-size:.9rem;color:var(--text-body)}
.ie-total b{font-size:1.05rem;color:var(--text-heading)}
@media (max-width:640px){
  .ie-row{grid-template-columns:1fr 64px 84px 26px;grid-auto-rows:auto}
  .ie-row .ie-sel{grid-column:1/-1;width:100%!important} /* mobile: full row beats the fitted width */
  .ie-row .ie-desc{grid-column:1/-1}
  .ie-newitem-grid{grid-template-columns:1fr 1fr}
}

/* ---------- Reports section (#reports) — the report engine ---------- */
.rpt-intro{margin:0 0 14px}
.rpt-soon h3{display:flex;align-items:center;gap:8px}
.rpt-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.rpt-presets{display:flex;gap:6px;flex-wrap:wrap}
.rpt-preset{padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-body);font-size:.76rem;font-weight:600;cursor:pointer;font-family:inherit}
.rpt-preset:hover{border-color:var(--brand);color:var(--brand)}
.rpt-preset.on{background:var(--brand);border-color:var(--brand);color:#fff}
.rpt-actions{display:flex;align-items:center;gap:6px}
.rpt-ctrl{align-items:flex-start}
.rpt-chips{display:flex;gap:6px;flex-wrap:wrap;flex:1;min-width:0}
.rpt-fchip{display:inline-flex;align-items:center;gap:6px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:.76rem}
.rpt-fchip b{color:var(--text-heading);font-weight:600;white-space:nowrap}
.rpt-fchip .input{height:26px;font-size:.76rem;padding:0 7px;width:auto;min-width:90px}
.rpt-fchip .rpt-n{width:78px;min-width:0}
.rpt-fchip .rpt-t{width:130px}
.rpt-fx{display:grid;place-items:center;width:20px;height:20px;border:none;border-radius:6px;background:none;color:var(--text-hint);cursor:pointer}
.rpt-fx:hover{background:var(--surface-2);color:var(--danger,#dc2626)}
.rpt-group{display:flex;align-items:center;gap:6px}
.rpt-group span{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-hint)}
.rpt-group .input{height:30px;font-size:.78rem;padding:0 8px;width:auto}
.rpt-sums{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.rpt-sum{display:flex;flex-direction:column;gap:1px;padding:8px 14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}
.rpt-sum span{font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.rpt-sum b{font-size:.92rem;color:var(--text-heading);font-variant-numeric:tabular-nums}
.rpt-run{flex:none;white-space:nowrap}
.rpt-prompt{color:var(--text-hint);padding:34px 16px!important}
/* view switcher (e.g. Financial: Collections / Receivables) */
.rpt-views{display:inline-flex;gap:3px;padding:3px;background:var(--surface-2);border:1px solid var(--border);border-radius:999px;margin-bottom:14px}
.rpt-view{background:none;border:none;padding:7px 16px;color:var(--text-hint);font-weight:600;font-size:.82rem;border-radius:999px;cursor:pointer;font-family:inherit}
.rpt-view.on{background:var(--surface);color:var(--text-heading);box-shadow:var(--shadow-sm)}
.rpt-view:hover:not(.on){color:var(--text-body)}
/* report table: zebra rows for readability; clickable rows (property opens its parcel) get a pointer + hover */
.rpt-page table.rt tbody tr:nth-child(even):not(.rt-group){background:var(--surface-2)}
.rpt-page table.rt tbody tr.rpt-rowlink{cursor:pointer}
.rpt-page table.rt tbody tr.rpt-rowlink:hover{background:var(--brand-soft,var(--surface-2))}
/* the query builder — one Field / Operator / Value row per condition */
.rpt-conds{display:flex;flex-direction:column;gap:8px;margin:0 0 14px}
.rpt-match{font-size:.8rem;color:var(--text-hint)}
.rpt-match .input{display:inline-block;width:auto;height:30px;padding:0 8px;font-size:.8rem;margin:0 2px}
.rpt-cond{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rpt-cond-w{flex:none;min-width:46px;text-align:right;font-size:.78rem;color:var(--text-hint)}
.rpt-cond .input{height:34px;font-size:.82rem;padding:0 10px;width:auto}
.rpt-cf{min-width:140px}
.rpt-co{min-width:104px}
.rpt-cv{min-width:140px}
.rpt-cv.rpt-n{width:120px;min-width:0}
.rpt-cv.rpt-t{min-width:160px}
.rpt-cand{font-size:.78rem;color:var(--text-hint)}
.rpt-fx{flex:none;display:grid;place-items:center;width:30px;height:30px;border:none;border-radius:7px;background:none;color:var(--text-hint);cursor:pointer}
.rpt-fx:hover{background:var(--surface-2);color:var(--danger,#dc2626)}
.rpt-fetch{flex:none;white-space:nowrap}
/* calm when the result is in sync; accent (with a dot) when the builder has unfetched changes */
.rpt-fetch:not(.rpt-dirty){background:var(--surface)!important;color:var(--text-hint)!important;border:1px solid var(--border)!important;box-shadow:none!important}
.rpt-fetch.rpt-dirty{position:relative}
.rpt-fetch.rpt-dirty::after{content:"";position:absolute;top:-4px;right:-4px;width:9px;height:9px;border-radius:50%;background:var(--brand);border:2px solid var(--surface)}
/* the Filter dropdown is on the LEFT of the bar — open it rightward so it isn't pushed off-screen
   (the Columns menu stays right-anchored since it lives on the right). Applies to every report page. */
#rptFPanel{left:0;right:auto}
.rpt-bar .rt-pop-panel,.rpt-ctrl .rt-pop-panel{z-index:120}
/* loading: the result's own shape in shimmering bars (reports.js skTiles / skRows — map.css .rt-sk); a report
   already on screen dims (.rt-busy) while the next one lands */
.rpt-sum.rpt-sk .rt-sk{display:block}
.rpt-sums.rt-busy{pointer-events:auto}
/* the walk's "what's next" — where the answer will appear while a question is still open */
.rpt-guide{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:40px 20px;color:var(--text-hint)}
.rpt-guide-ico{width:48px;height:48px;border-radius:50%;background:var(--surface-2);color:var(--text-hint);display:flex;align-items:center;justify-content:center;margin-bottom:4px}
.rpt-guide h3{font-size:var(--fs-subheading);font-weight:var(--fw-subheading);color:var(--text-heading);margin:0}
.rpt-guide p{margin:0;max-width:440px;font-size:var(--fs-hint)}
.rpt-walkbar{margin-bottom:12px}
/* a grouped report: one line per group, opened on tap for its rows; "Show more" pulls the next page */
.rpt-page table.rt tr.rpt-grow td{cursor:pointer;user-select:none}
.rpt-page table.rt tr.rpt-grow:hover td{background:var(--surface-2)}
.rpt-gcaret{display:inline-flex;vertical-align:middle;margin-right:8px;color:var(--text-hint);transform:rotate(-90deg);transition:transform .18s ease}
.rpt-grow.open .rpt-gcaret{transform:none;color:var(--brand)}
.rpt-page table.rt tr.rpt-more td{text-align:center;padding:10px 14px;background:var(--surface)}
.rpt-more span{margin-left:12px;font-size:var(--fs-hint);color:var(--text-hint)}
.rpt-foot{margin:10px 2px 0;font-size:var(--fs-hint);color:var(--text-hint)}
.rpt-foot:empty{display:none}
@media (prefers-reduced-motion:reduce){.rpt-gcaret{transition:none}}
.rpt-refine-hint{font-size:var(--fs-small);color:var(--text-hint)}

/* ── the Financial walk (reports.js walk): three questions in one card, folio's report page compressed ──
   One step open at a time; a folded step carries its answer beside the question; steps not reached yet are
   greyed and inert; all answered, the three fold into one sentence. Bodies fold by grid rows (0fr ↔ 1fr), so
   they animate to whatever their chips need. */
.rw{padding:0;margin-bottom:16px;overflow:hidden}
.rw-swap{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .3s ease,opacity .25s ease}
.rw-swap-inner{min-height:0;overflow:hidden}
.rw-sentence-wrap,.rw.condensed .rw-steps-body{grid-template-rows:0fr;opacity:0}
.rw.condensed .rw-sentence-wrap{grid-template-rows:1fr;opacity:1}
.rw-sentence{display:flex;align-items:center;gap:12px;width:100%;padding:10px 16px;border:0;background:none;font-family:inherit;color:inherit;text-align:left;cursor:pointer}
.rw-sentence:hover .rw-edit{color:var(--brand)}
.rw-sentence:focus-visible{outline:none;box-shadow:inset 0 0 0 3px var(--brand-soft)}
.rw-sentence-text{display:flex;align-items:center;flex-wrap:wrap;gap:6px;flex:1;min-width:0}
.rw-word{font-size:var(--fs-hint);color:var(--text-hint)}
.rw-edit{display:inline-flex;align-items:center;gap:2px;flex:none;font-size:var(--fs-small);font-weight:700;color:var(--text-hint);transition:color .15s}
.rw-step{border-bottom:1px solid var(--border);transition:opacity .35s ease}
.rw-step:last-of-type{border-bottom:0}
.rw-step.muted{opacity:.45}
.rw-step.muted .rw-step-head{cursor:default}
.rw-step.muted .rw-step-chevron{visibility:hidden}
.rw-step.muted .rw-step-num{background:var(--text-hint)}
.rw-step-head{display:flex;align-items:center;gap:10px;width:100%;padding:13px 16px;border:0;background:none;font-family:inherit;color:inherit;text-align:left;cursor:pointer;transition:padding .25s ease}
.rw-step.folded .rw-step-head{padding-top:9px;padding-bottom:9px}
.rw-step.unanswered .rw-step-head{cursor:default}
.rw-step-head:focus-visible{outline:none;box-shadow:inset 0 0 0 3px var(--brand-soft)}
.rw-step-num{flex:none;width:22px;height:22px;border-radius:50%;background:var(--brand);color:#fff;font-size:.72rem;font-weight:800;display:flex;align-items:center;justify-content:center;transition:background .35s ease}
.rw-step-text{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;min-width:0;flex:1}
.rw-step-title{font-size:var(--fs-body);font-weight:700;color:var(--text-heading)}
.rw-step.folded .rw-step-title{color:var(--text-hint);font-weight:600}
.rw-step-summary{display:none;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.rw-step.folded .rw-step-summary{display:flex;animation:rw-summary-in .25s ease backwards}
.rw-sum-item{display:inline-flex;align-items:center;gap:6px;padding:2px 10px 2px 2px;border-radius:999px;background:var(--brand-soft);color:var(--brand-deep,var(--brand));font-size:var(--fs-small);font-weight:700;max-width:100%}
.rw-sum-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rw-sum-icon{flex:none;width:20px;height:20px;border-radius:50%;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center}
.rw-sum-icon svg{width:12px;height:12px}
.rw-step-chevron{flex:none;display:flex;color:var(--text-hint);transform:rotate(180deg);transition:transform .25s ease,color .15s}
.rw-step.folded .rw-step-chevron{transform:none}
.rw-step-head:hover .rw-step-chevron{color:var(--brand)}
.rw-step.unanswered .rw-step-chevron{visibility:hidden}
.rw-step-body{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .28s ease,opacity .2s ease}
.rw-step.folded .rw-step-body{grid-template-rows:0fr;opacity:0}
.rw-step-inner{min-height:0;overflow:hidden}
.rw-step-pad{padding:2px 16px 14px}
.rw-chips{display:flex;flex-wrap:wrap;gap:7px;min-width:0}
.rw-chip{display:inline-flex;align-items:center;gap:8px;padding:5px 11px 5px 5px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text-body);font-family:inherit;font-size:var(--fs-hint);text-align:left;cursor:pointer;max-width:100%;transition:border-color .15s,background .15s}
.rw-chip:hover{border-color:var(--brand)}
.rw-chip:focus-visible{outline:none;box-shadow:0 0 0 3px var(--brand-soft)}
.rw-chip.on{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-deep,var(--brand))}
.rw-chip-icon{flex:none;width:26px;height:26px;border-radius:7px;background:var(--surface-2);color:var(--text-hint);display:flex;align-items:center;justify-content:center}
.rw-chip.on .rw-chip-icon{background:var(--brand);color:#fff}
.rw-chip-text{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.rw-chip-label{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rw-chip-sub{font-size:var(--fs-small);color:var(--text-hint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rw-chip.on .rw-chip-sub{color:inherit;opacity:.8}
.rw-scope{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center}
.rw-time,.rw-dates{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.rw-time .input{width:auto;height:36px;font-size:var(--fs-hint);padding:0 10px}
.rw-dates-to{font-size:var(--fs-hint);color:var(--text-hint)}
.rw-foot{display:flex;justify-content:flex-end;padding:8px 16px;border-top:1px solid var(--border)}
.rw-link{border:0;background:none;padding:4px 0;font-family:inherit;font-size:var(--fs-hint);font-weight:700;color:var(--brand);cursor:pointer}
.rw-link:hover{text-decoration:underline}
@keyframes rw-summary-in{from{opacity:0;transform:translateX(-4px)}}
@media (max-width:600px){ .rw-step-head{padding-left:12px;padding-right:12px} .rw-step-pad{padding:2px 12px 12px} .rw-sentence{padding:10px 12px} }
@media (prefers-reduced-motion:reduce){ .rw-swap,.rw-step,.rw-step-head,.rw-step-chevron,.rw-step-body,.rw-step-num{transition:none} .rw-step.folded .rw-step-summary{animation:none} }
.rpt-spinner{width:18px;height:18px;border:2.5px solid var(--border);border-top-color:var(--brand);border-radius:50%;animation:rpt-spin .7s linear infinite}
@keyframes rpt-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.rpt-spinner{animation-duration:2.4s}}
@media (max-width:760px){
  .rpt-bar{gap:8px}
  .rpt-actions{margin-left:auto}
  .rpt-fchip .input{min-width:70px}
}

/* ==========================================================================
   Trade License Certificate editor (trade-certificate.html, cert-)
   ========================================================================== */
.cert-page{display:flex;flex-direction:column;gap:16px}
/* a standalone page (no #routeView): clear the fixed sidebar the way #routeView and .rp do — a centred
   .content slid under the nav and cut off the form and the back link */
.content.cert-page{max-width:none;margin:0;padding-left:calc(var(--nav-gap) + 26px);transition:padding-left .26s ease}
@media (max-width:640px){
  .content.cert-page{padding-left:14px;padding-right:14px}
}
/* the page's header (#topbar, as on the licence page): back · the page name over the business · Send · Print */
.cert-htitle{min-width:0;display:flex;flex-direction:column;line-height:1.2}
.cert-htitle .gh-doc-title{overflow:hidden;text-overflow:ellipsis}
.cert-htitle small{font-size:var(--fs-small);color:var(--text-hint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cert-htitle small:empty{display:none}
body[data-page="trade-certificate"] .gh-controls{flex-wrap:nowrap;gap:10px}
body[data-page="trade-certificate"] .gh-controls .btn{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
body[data-page="trade-certificate"] .gh-controls .btn[hidden]{display:none}
body[data-page="trade-certificate"] .gh-controls .gh-pay-label{margin:0}
body[data-page="trade-certificate"] .content.cert-page{padding-top:16px}
body.has-header.nav-collapsed .content.cert-page{padding-left:14px} /* the header reclaims the hidden nav's lane; the page follows it */
@media print{ body[data-page="trade-certificate"] .content.cert-page{padding:0} } /* the spacing above outranks the print reset: without this the page ran onto a blank second sheet */
.cert-htitle{flex:0 1 auto}
/* phones: ONE row — menu, back, the title (it gives way first), then the two actions as icons (their titles say what they do) */
@media (max-width:640px){
  body[data-page="trade-certificate"].has-header #topbar{flex-wrap:nowrap;gap:8px}
  body[data-page="trade-certificate"] .gh-doc-title{font-size:.95rem}
  body[data-page="trade-certificate"] .cert-htitle small{display:none}
  body[data-page="trade-certificate"] .gh-controls{gap:7px}
  body[data-page="trade-certificate"] .gh-controls .gh-pay-label{display:none}
  body[data-page="trade-certificate"] .gh-controls .btn{width:38px;height:38px;padding:0;justify-content:center}
}
.cert-editor{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:stretch}
.cert-form{padding:16px;display:flex;flex-direction:column;gap:12px;align-self:start}
.cert-fieldhint{color:var(--text-hint);font-size:var(--fs-small);margin-top:5px;line-height:1.35}
/* a licence's certificate saves to the licence (trade-certificate.js): where that stands */
.cert-save{margin:0;padding:8px 10px;border-radius:8px;background:var(--surface-2);color:var(--text-hint);font-size:var(--fs-hint);line-height:1.35}
.cert-save:empty{display:none}
.cert-save.bad{background:rgba(220,38,38,.12);color:var(--bad);font-weight:600}
.cert-form .input[readonly]{background:var(--surface-2);color:var(--text-hint)}
.cert-stagewrap{display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-3);height:min(calc(100vh - 180px),840px);min-height:430px}
/* The stage is the council's own certificate, measured from a real one (letter landscape = 1056×816 px at 96dpi):
   every layer sits at the PDF's box and every text line on the PDF's baseline (Times New Roman 14/16/28pt, Word's
   single spacing = 1.15 × size). Layers: cert-stage.js builds them. The certificate is a paper document — its colours
   and fonts are part of the artwork and intentionally NOT theme tokens: it must look and print identically in light
   or dark mode. */
.cert-stage{flex:0 0 auto;position:relative;width:1056px;height:816px;background:#fff;overflow:hidden;box-shadow:0 22px 55px -24px rgba(15,23,42,.5);
  font-family:'Times New Roman',Times,serif;font-kerning:normal;color:#000} /* the PDF's text is kerned */
.cert-stage img{position:absolute;display:block;max-width:none}
.cert-border{left:16.2px;top:3.9px;width:1023.5px;height:808.2px}
.cert-seal-wm{left:278.9px;top:194.9px;width:501px;height:494px;opacity:.1176} /* the PDF draws it at 30/255 */
.cert-art{left:0;top:0;width:1056px;height:816px} /* board header, schedule, title, arched lettering (vector, from the PDF) */
.cert-seal-top{left:96px;top:84px;width:90px;height:88px}
/* the text column is a FLOW from the "Issued by" line: each paragraph's margin is the gap measured between the
   PDF's boxes, so a name or clause that runs to another line pushes the rest down a line, as Word does */
.cert-flow{position:absolute;left:0;top:252.3px;width:1056px;text-align:center;font-size:18.667px;line-height:21.467px;white-space:nowrap}
.cert-flow>*{margin:0}
.cert-business{margin-top:11.233px;font-size:37.333px;line-height:42.933px;white-space:normal}
.cert-owner{margin-top:12.867px;font-size:21.333px;line-height:24.533px;white-space:normal}
.cert-clause{margin:64.133px auto 0;width:820px;font-size:18.667px;line-height:21.467px;white-space:normal} /* the PDF's box: its lines run to 815px, and "it" / "is" break as they do there (the size is set, not inherited: the app's own `p` rule would win over inheritance) */
.cert-given{margin-top:21.467px} /* one blank line after the clause */
.cert-numgap{display:inline-block;width:32.7px} /* the PDF's run of spaces between the two numbers */
.cert-sign{position:absolute;top:682px;width:auto;margin:0;text-align:center;font-size:18.667px;line-height:21.467px;white-space:nowrap;transform:translateX(-50%)}
.cert-sign-1{left:202.9px}
.cert-sign-2{left:507.9px}
.cert-sign-3{left:819.1px}

@media (max-width:980px){
  .cert-editor{grid-template-columns:1fr}
  .cert-stagewrap{height:auto;aspect-ratio:1056/816;min-height:0}
}

/* Print: the certificate alone, full-bleed on a letter-landscape page.
   The stage is 1056×816px = exactly 11in × 8.5in at 96dpi, so transform:none
   fills the sheet 1:1. */
@media print{
  @page{size:letter landscape;margin:0}
  body[data-page="trade-certificate"]{background:#fff}
  body[data-page="trade-certificate"] #sidebar,
  body[data-page="trade-certificate"] #topbar,
  body[data-page="trade-certificate"] .cert-form{display:none !important}
  body[data-page="trade-certificate"] .layout,
  body[data-page="trade-certificate"] .main,
  body[data-page="trade-certificate"] .content,
  body[data-page="trade-certificate"] .cert-editor,
  body[data-page="trade-certificate"] .cert-stagewrap{display:block;margin:0;padding:0;max-width:none;border:0;border-radius:0;background:#fff;height:auto;min-height:0;overflow:visible}
  body[data-page="trade-certificate"] .cert-stage{transform:none !important;box-shadow:none;position:fixed;left:0;top:0;width:11in;height:8.5in}
}

/* ==========================================================================
   Trade Licenses (trade.js — list reuses the rt-* table; detail = tl-*)
   ========================================================================== */
.tl-link{display:inline-block;padding:2px 9px;border-radius:999px;font-size:var(--fs-small);font-weight:700;letter-spacing:.02em}
.tl-link.linked{background:rgba(21,128,61,.13);color:var(--ok)}
.tl-link.suggested{background:rgba(217,119,6,.15);color:var(--warn)}
.tl-link.unlinked{background:rgba(220,38,38,.12);color:var(--bad)}
.tl-link.deactivated{background:var(--surface-3);color:var(--text-subheading)}
.rt tr.tl-row-closed td{color:var(--text-hint)}
/* a deactivated licence: the banner on its page + the Deactivate sheet (trade.js closedBanner / openDeactivate) */
.tl-closed{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px;border-left:3px solid var(--bad)}
.tl-closed-ico{flex:none;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(220,38,38,.12);color:var(--bad)}
.tl-closed-why{color:var(--text-heading);margin:3px 0}
.tl-deact-bills{padding:10px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.tl-deact-h{font-weight:700;color:var(--text-heading);margin-bottom:4px}
.tl-deact-reason{margin-top:16px}
.tl-reasons{display:flex;flex-wrap:wrap;gap:6px}
.tl-reason{appearance:none;min-height:36px;padding:6px 14px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-body);font:inherit;font-size:var(--fs-hint);font-weight:600;cursor:pointer}
.tl-reason:hover{border-color:var(--brand);color:var(--brand)}
.tl-reason.on{background:var(--brand-soft);border-color:var(--brand);color:var(--brand-deep)}
/* loading: the page's shape in shimmering bars (map.css .rt-sk / pc-pulse), the record fading in over it (trade.js
   detailSkeleton / invoicesSkeleton; the list uses the table's rt-sk-row + row-in) */
@keyframes tl-reveal{from{opacity:0}to{opacity:1}}
.tl-reveal{animation:tl-reveal .24s ease}
.tl-sk-fld{align-items:center}
.tl-sk-fld .rt-sk{height:10px}
.tl-sk-certcard{display:flex;flex-direction:column;gap:10px}
.tl-sk-cert{aspect-ratio:1056/816;border-radius:8px;background:var(--surface-2);box-shadow:var(--shadow);animation:pc-pulse 1.2s ease-in-out infinite}
.tl-sk-cta{display:block;height:40px;border-radius:9px;background:var(--surface-3)}
.tl-sum .tl-sk-big{width:40%;height:30px;margin:4px auto 10px}
.tl-sum .tl-sk-cap{width:30%;height:9px;margin:0 auto 14px}
.tl-sk-inv{cursor:default}
.tl-sk-inv:hover{background:none}
.tl-sk-inv .tl-inv-main{width:46%}
.tl-sk-inv .tl-inv-right{width:24%;justify-content:flex-end}
.tl-deact-bills .rt-sk{margin:5px 0}
@media (prefers-reduced-motion:reduce){.tl-reveal,.tl-sk-cert{animation:none}}
/* New trade licence (trade.js renderNew) — one column of cards, two-up fields */
.tl-new-btn{display:inline-flex;align-items:center;gap:6px;text-decoration:none;flex:none;min-height:38px}
.gh-controls .tl-new-btn svg{margin-right:0}
/* the Trade list's own search, IN the top bar (trade.js toolsHTML) — always open, it's the page's main tool */
.tl-hsearch{position:relative;display:flex;align-items:center;flex:0 1 300px;min-width:140px}
.tl-hsearch svg{position:absolute;left:11px;color:var(--text-hint);pointer-events:none}
.tl-hsearch .input{padding-left:35px}
@media (max-width:760px){ .tl-hsearch{flex:1 1 auto;min-width:0} .gh-controls .tl-new-btn span{display:none} .gh-controls .tl-new-btn{width:38px;padding:0;justify-content:center} }
.tl-detail.tl-new{max-width:780px}
.tl-nform{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.tl-nform-gap{margin-top:14px}
.tl-ef-wide{grid-column:1/-1}
.tl-ef-hint{color:var(--text-hint);font-size:var(--fs-small);line-height:1.35}
.tl-req{color:var(--bad);font-style:normal}
.tl-new .input.bad{border-color:var(--bad);box-shadow:0 0 0 3px rgba(220,38,38,.12)}
.tl-nlead{margin:0 0 12px}
.tl-nlead-inline{align-self:center;font-size:var(--fs-hint)}
.tl-new .tl-acts .btn svg{vertical-align:-3px}
.tl-new-acts{justify-content:flex-end;margin-top:0}
.tl-new-acts .btn{min-height:42px;padding-left:20px;padding-right:20px}
.tl-dupes{display:flex;flex-direction:column;gap:6px;margin-top:14px;padding:10px 12px;border-radius:10px;background:rgba(217,119,6,.1);color:var(--text-body);font-size:var(--fs-hint)}
.tl-dupes b{color:var(--warn)}
.tl-dupes .lk-row{text-decoration:none}
@media (max-width:600px){ .tl-nform{grid-template-columns:1fr} }
/* the owner TAG under a business name in the list (trade.js ownerTag) — a button: profile / suggestion / owner search */
.rt-name .rt-sub.tl-tagline{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:4px} /* beats map.css's .rt-name .rt-sub (loads later) */
.tl-tag-roll{color:var(--text-hint);min-width:0;overflow:hidden;text-overflow:ellipsis}
.tl-tag{appearance:none;display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:2px 8px;border:1px solid transparent;border-radius:999px;
  font:inherit;font-size:var(--fs-small);font-weight:700;letter-spacing:.01em;line-height:1.5;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-tag span{overflow:hidden;text-overflow:ellipsis}
.tl-tag svg{flex:none}
.tl-tag.linked{background:rgba(21,128,61,.13);color:var(--ok)}
.tl-tag.suggested{background:rgba(217,119,6,.15);color:var(--warn)}
.tl-tag.unlinked{background:rgba(220,38,38,.12);color:var(--bad)}
/* the Owner column (trade.js ownerCell): the roll's name beside its tag, in one line that ellipsises with the cell */
.tl-ownercell{display:inline-flex;align-items:center;gap:7px;max-width:100%;vertical-align:middle;min-width:0}
.tl-ownercell .tl-tag-roll{flex:0 1 auto;white-space:nowrap}
.tl-ownercell .tl-tag{flex:none}
.tl-tag-static{cursor:default}
.tl-tag:hover{border-color:currentColor}
.tl-tag:focus-visible{outline:2px solid currentColor;outline-offset:1px}
/* the suggestion popover, pinned under its tag (position set in trade.js) */
.tl-tagpop{position:fixed;z-index:1200;width:370px;max-width:calc(100vw - 16px);padding:12px 14px;background:var(--surface);color:var(--text);
  border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);font-size:var(--fs-body)}
.tl-tagpop-t{color:var(--text-heading);margin-bottom:3px}
.tl-tagpop .tl-acts{margin-top:10px}

.tl-detail{max-width:1040px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
.tl-back{align-self:flex-start;gap:5px}
.tl-back svg{vertical-align:-3px;margin-right:3px}
.tl-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.tl-title{font-size:var(--fs-h1);font-weight:var(--fw-heading);color:var(--text-heading)}
.tl-sub{color:var(--text-hint);font-size:var(--fs-hint);margin-top:4px}
.tl-head-tags{display:flex;align-items:center;gap:8px}
.tl-status{display:inline-block;padding:2px 10px;border-radius:999px;font-size:var(--fs-small);font-weight:700;text-transform:capitalize;background:var(--surface-3);color:var(--text-subheading)}

.tl-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.tl-card{padding:16px 18px}
.tl-card h3{font-size:var(--fs-subheading);font-weight:var(--fw-subheading);color:var(--text-heading);margin-bottom:10px;display:flex;align-items:center;gap:8px}
.tl-cycle{font-size:var(--fs-small);font-weight:600;color:var(--text-hint);background:var(--surface-3);padding:1px 8px;border-radius:999px;letter-spacing:.02em}
.tl-fld{display:flex;justify-content:space-between;gap:14px;padding:6px 0;border-bottom:1px solid var(--border);font-size:var(--fs-body)}
.tl-fld:last-child{border-bottom:0}
.tl-fld-k{color:var(--text-hint)}
.tl-fld-v{color:var(--text-body);text-align:right}
.tl-owe{color:var(--bad)}
.tl-muted{color:var(--text-hint)}
.tl-a{color:var(--brand);font-weight:600;text-decoration:none}
.tl-a:hover{text-decoration:underline}

.tl-log h3{margin-bottom:12px}
.tl-ev{display:flex;gap:10px;padding:7px 0;font-size:var(--fs-body)}
.tl-ev-dot{flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:var(--brand);margin-top:6px}
.tl-ev-note{color:var(--text-hint);font-size:var(--fs-hint);margin-top:2px}

@media (max-width:760px){ .tl-cards{grid-template-columns:1fr} }

/* Trade detail — invoices tab rows */
.tl-inv-list{margin:4px 0}
.tl-inv{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;background:none;border:0;border-bottom:1px solid var(--border);padding:11px 2px;cursor:pointer;text-align:left;color:var(--text-body);font-family:inherit;font-size:var(--fs-body)}
.tl-inv:last-of-type{border-bottom:0}
.tl-inv:hover{background:var(--surface-2)}
.tl-inv-main{display:flex;flex-direction:column;gap:2px;min-width:0}
.tl-inv-sub{color:var(--text-hint);font-size:var(--fs-hint)}
.tl-inv-right{display:flex;align-items:center;gap:10px;flex:none}
.tl-amt{font-variant-numeric:tabular-nums;font-weight:600}
.tl-inv-total{border-top:1px solid var(--border);margin-top:6px;padding-top:10px}

/* ==========================================================================
   Trade detail — 2-column elegant, editable record (tl-grid)
   ========================================================================== */
.tl-detail{max-width:1120px;margin:0 auto}
.tl-grid{display:grid;grid-template-columns:340px minmax(0,1fr);gap:18px;align-items:start}
.tl-col{display:flex;flex-direction:column;gap:16px;min-width:0}
.tl-col-left{position:sticky;top:14px}
@media (max-width:880px){ .tl-grid{grid-template-columns:1fr} .tl-col-left{position:static} }

.tl-card{padding:18px 20px}
.tl-card-h{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.tl-card-h h3{margin:0}
.tl-iconbtn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-hint);cursor:pointer}
.tl-iconbtn:hover{color:var(--brand);border-color:var(--brand)}
.tl-add{background:none;border:1px dashed var(--border);color:var(--brand);font-weight:600;font-size:var(--fs-hint);border-radius:7px;padding:2px 11px;cursor:pointer}
.tl-add:hover{border-color:var(--brand);background:var(--brand-soft)}

/* certificate preview card — a real, scaled miniature of the printable .cert-stage */
.tl-certcard{display:flex;flex-direction:column;gap:10px;width:100%;background:none;border:0;padding:0;cursor:pointer}
.tl-cert-scaler{position:relative;width:100%;aspect-ratio:1056/816;overflow:hidden;border-radius:8px;box-shadow:var(--shadow);background:#fff}
.tl-cert-scaler .cert-stage{position:absolute;top:0;left:0;transform-origin:top left;box-shadow:none !important}
.tl-certcard-cta{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:var(--brand);color:#fff;border-radius:9px;padding:10px;font-weight:600;font-size:var(--fs-hint)}
.tl-certcard-cta svg{stroke:#fff}
.tl-certcard:hover .tl-certcard-cta{background:var(--brand-bright)}
.tl-certcard:hover .tl-cert-scaler{box-shadow:0 18px 44px -18px rgba(15,23,42,.55)}

/* balance summary card */
.tl-sum{text-align:center}
.tl-sum-big{font-size:2rem;font-weight:800;color:var(--text-heading);font-variant-numeric:tabular-nums;line-height:1.1}
.tl-sum-big.tl-owe{color:var(--bad)}
.tl-sum-big.tl-clear{color:var(--ok)}
.tl-sum-cap{color:var(--text-hint);font-size:var(--fs-hint);margin-bottom:12px}
.tl-sum-rows{text-align:left;border-top:1px solid var(--border);padding-top:4px}

/* owner card */
.tl-owner-head{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.tl-avatar{flex:none;width:44px;height:44px;border-radius:50%;background:var(--brand-soft);color:var(--brand-deep);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1rem}
.tl-avatar.sm{width:36px;height:36px;font-size:.85rem}
.tl-owner-id{flex:1;min-width:0}
.tl-owner-name{font-weight:700;color:var(--text-heading)}
.tl-owner-sub{color:var(--text-hint);font-size:var(--fs-hint);font-variant-numeric:tabular-nums}
.tl-acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.tl-suggest{display:flex;align-items:center;gap:11px;padding:4px 0}
/* owner: the register's possible matches (one tap links) + the search-first picker */
.tl-cands{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.tl-pick{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.tl-pick-list{display:flex;flex-direction:column;gap:6px;max-height:320px;overflow:auto}
.tl-missing{display:flex;align-items:center;gap:12px;color:var(--text-body)}
.tl-missing-ico{flex:none;width:44px;height:44px;border-radius:50%;background:var(--surface-3);color:var(--text-hint);display:flex;align-items:center;justify-content:center}
.tl-owner-missing{border:1px dashed var(--border);background:var(--surface-2)}

/* inline edit forms */
.tl-eform{display:flex;flex-direction:column;gap:11px}
.tl-ef{display:flex;flex-direction:column;gap:5px}
.tl-ef>span{font-size:var(--fs-hint);color:var(--text-hint);font-weight:600}
.tl-ef-check{flex-direction:row;align-items:center;gap:8px}
.tl-ef-check>span{color:var(--text-body)}

/* parcel typeahead */
.tl-pick{display:flex;flex-direction:column;gap:8px}
.tl-pick-list{display:flex;flex-direction:column;gap:6px;max-height:240px;overflow:auto}

/* collectors — receive-payment overlay + parcel invoice card */
.pd-inv-card h3{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pd-inv-more{margin-top:10px}
.pd-receive{margin-left:auto}
.po-suggest{margin:4px 0 10px;display:flex;flex-direction:column;gap:6px}
.po-suggest-h{font-size:.7rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--text-hint)}
.po-suggest-chip{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:8px 10px;border:1px solid color-mix(in srgb, var(--ok) 40%, var(--border));background:color-mix(in srgb, var(--ok) 7%, var(--surface));border-radius:var(--radius);cursor:pointer}
.po-suggest-chip:hover{background:color-mix(in srgb, var(--ok) 13%, var(--surface))}
.po-suggest-name{font-weight:700;color:var(--text-heading)}
.po-suggest-meta{font-size:.72rem;color:var(--text-hint);font-variant-numeric:tabular-nums}
.po-suggest-link{margin-left:auto;font-weight:700;color:var(--ok)}

/* ============================================================
   Collect (#collect) — "Ledger cards on a calm canvas".
   The page is a search bar (in the top bar, where the bell was) and a stack of
   customer cards on a neutral canvas: one white card per matching customer, muted
   property strips carrying the ONLY orange button, 44px bill rows with right-aligned
   tabular money and quiet dot statuses. Orange appears in exactly five places: Make
   payment / Link N to parcel (solid), the selected pill (tint), the active Filter
   button (tint + dot), the search focus ring, the selected row tint + checkbox.
   Everything else is Nucleus neutrals (nucleus-scheduler/design-system: cal.com-
   derived tokens, Inter, hairline borders, tiny shadows, 6px controls, 12px cards).
   Tokens are scoped to the ROUTE's bar, canvas and page — never body — so overlays
   rendered into body (EHubPay, EHubLinkParcel, EHubInvoice) keep the app surfaces.
   The shared .rt- table kit (map.css) paints from the APP's token names, so those
   names are remapped inside this scope and the kit re-skins itself — no fork.
   ============================================================ */
/* ── the Nucleus --cal-* sheet is SHARED with the profile console (.pd) and stays as it
      was; the Collect rules below read the --cl-* names declared after it ── */
:where(.cl-page,.pd){
  /* ── Nucleus tokens — LIGHT ── */
  --cal-bg:hsla(0,0%,100%,1);
  /* the greys are the app's central scale (theme.css --gray-*): one change there reaches here */
  --cal-bg-subtle:var(--gray-3);
  --cal-bg-muted:var(--gray-2);
  --cal-bg-emphasis:var(--gray-4);
  --cal-border:var(--gray-5);
  --cal-border-subtle:var(--gray-4);
  --cal-border-emphasis:hsla(218,11%,65%,1);
  --cal-text-emphasis:hsla(210,30%,4%,1);
  --cal-text:hsla(220,6%,25%,1);
  --cal-text-subtle:hsla(220,9%,46%,1);
  --cal-text-muted:hsla(218,11%,65%,1);
  --cal-brand:hsla(221,39%,11%,1);
  --cal-brand-emphasis:hsla(0,0%,6%,1);
  --cal-brand-text:hsla(0,0%,100%,1);
  --cal-error:hsla(0,63%,31%,1);
  --radius-btn:6px; --radius-xl:8px;
  --shadow-card:0 1px 2px 0 rgba(0,0,0,.05),0 1px 3px 0 rgba(0,0,0,.04);
  --shadow-brand:0 1px 2px rgba(0,0,0,.18),0 2px 4px rgba(0,0,0,.08),inset 0 1px 0 rgba(255,255,255,.14);
  --font-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;

  /* ── remap the app's token names so inherited components adopt the kit ── */
  --surface:var(--cal-bg); --surface-2:var(--cal-bg-muted); --surface-3:var(--cal-bg-subtle);
  --bg:var(--cal-bg-muted); --field-bg:var(--cal-bg);
  --border:var(--cal-border-subtle);
  --text-heading:var(--cal-text-emphasis); --text-body:var(--cal-text);
  --text-subheading:var(--cal-text); --text-hint:var(--cal-text-subtle);
  --text:var(--cal-text); --text-muted:var(--cal-text-muted);
  /* --brand / --brand-bright / --brand-soft are deliberately NOT remapped: every accent
     the shared kit draws from them stays the company orange. Nucleus supplies the
     surfaces and type; the brand stays ours. */
  --ico-bg:var(--brand-soft);
  --radius:8px; --radius-sm:5px; --radius-lg:8px;
  --shadow:var(--shadow-card); --shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);
}
/* ── Nucleus tokens — DARK. The OS drives it here (this app has no toggle);
      a [data-theme] attribute, if one is ever added, wins over the OS. ── */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) :where(.cl-page,.pd){
    --cal-bg:hsla(0,0%,6%,1); --cal-bg-subtle:hsla(0,0%,15%,1); --cal-bg-muted:hsla(0,0%,9%,1);
    --cal-bg-emphasis:hsla(0,0%,25%,1);
    --cal-border:hsla(0,0%,30%,1); --cal-border-subtle:hsla(0,0%,15%,1); --cal-border-emphasis:hsla(0,0%,45%,1);
    --cal-text-emphasis:hsla(0,0%,98%,1); --cal-text:hsla(0,0%,83%,1);
    --cal-text-subtle:hsla(0,0%,64%,1); --cal-text-muted:hsla(0,0%,64%,1);
    --cal-brand:hsla(0,0%,100%,1); --cal-brand-emphasis:hsla(0,0%,90%,1); --cal-brand-text:hsla(0,0%,0%,1);
    --cal-error:hsla(0,84%,70%,1);
    --shadow-brand:0 1px 2px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.06);
  }
}
:root[data-theme="dark"] :where(.cl-page,.pd){
  --cal-bg:hsla(0,0%,6%,1); --cal-bg-subtle:hsla(0,0%,15%,1); --cal-bg-muted:hsla(0,0%,9%,1);
  --cal-bg-emphasis:hsla(0,0%,25%,1);
  --cal-border:hsla(0,0%,30%,1); --cal-border-subtle:hsla(0,0%,15%,1); --cal-border-emphasis:hsla(0,0%,45%,1);
  --cal-text-emphasis:hsla(0,0%,98%,1); --cal-text:hsla(0,0%,83%,1);
  --cal-text-subtle:hsla(0,0%,64%,1); --cal-text-muted:hsla(0,0%,64%,1);
  --cal-brand:hsla(0,0%,100%,1); --cal-brand-emphasis:hsla(0,0%,90%,1); --cal-brand-text:hsla(0,0%,0%,1);
  --cal-error:hsla(0,84%,70%,1);
  --shadow-brand:0 1px 2px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.06);
}

/* ── the Collect token sheet: bar + canvas + page (NOT body — see the block comment) ── */
body[data-page="collect"] #topbar,
body[data-page="collect"] #routeView,
.cl-page{
  --font-sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  /* surfaces */
  --cl-canvas:var(--gray-2); --cl-card:#fff; --cl-card-2:var(--gray-1); --cl-field:var(--gray-2); /* greys: theme.css --gray-* */
  --cl-row-hover:color-mix(in srgb,var(--cl-text-emphasis) 3.5%,transparent);
  --cl-row-sel:color-mix(in srgb,var(--brand) 8%,transparent);
  /* lines */
  --cl-border:var(--gray-4); --cl-border-subtle:var(--gray-3); --cl-border-strong:var(--gray-5);
  /* text */
  --cl-text-emphasis:hsl(210 30% 4%); --cl-text:hsl(220 6% 25%); --cl-text-subtle:hsl(220 9% 46%); --cl-text-muted:hsl(218 11% 62%);
  /* money + status */
  --cl-neg:#B91C1C; --cl-neg-soft:color-mix(in srgb,#DC2626 10%,transparent);
  --cl-pos:#15803D; --cl-warn:#B45309; --cl-warn-soft:color-mix(in srgb,#D97706 12%,transparent);
  /* the orange, exhaustively */
  --cl-accent-hover:#D9620A; --cl-accent-pressed:#C2570A; --cl-accent-text:#9A3412;
  --cl-accent-soft:color-mix(in srgb,var(--brand) 10%,transparent);
  --cl-accent-border:color-mix(in srgb,var(--brand) 55%,transparent);
  --cl-accent-ring:color-mix(in srgb,var(--brand) 22%,transparent);
  /* depth + shape */
  --cl-shadow-card:0 1px 2px rgba(0,0,0,.05),0 1px 3px rgba(0,0,0,.04);
  --cl-shadow-pop:0 4px 12px -2px rgba(0,0,0,.08),0 1px 3px rgba(0,0,0,.06);
  --cl-shadow-brand:0 1px 2px rgba(0,0,0,.18),0 2px 4px rgba(0,0,0,.08),inset 0 1px 0 rgba(255,255,255,.14);
  --cl-radius-card:12px; --cl-radius-ctl:6px; --cl-radius-search:6px; --cl-gap:12px;
  /* density — fine pointer */
  --cl-h-header:64px; --cl-h-search:38px; --cl-h-ctl:36px; --cl-h-btn:36px; --cl-h-pill:34px;
  --cl-h-legend:36px; --cl-h-cust:60px; --cl-h-prop:48px; --cl-h-row:44px; --cl-h-opt:36px;
  --cl-w-check:44px; --cl-cb:18px; --cl-clear:32px; --cl-h-selbar:52px;
  --cl-indent:calc(16px + var(--cl-w-check));
  /* keep the shared .rt-/.btn/.badge kit painting from these names */
  --surface:var(--cl-card); --surface-2:var(--cl-card-2); --surface-3:var(--cl-canvas); --bg:var(--cl-canvas); --field-bg:var(--cl-field);
  --border:var(--cl-border); --text-heading:var(--cl-text-emphasis); --text-body:var(--cl-text);
  --text-subheading:var(--cl-text); --text-hint:var(--cl-text-subtle); --text:var(--cl-text); --text-muted:var(--cl-text-muted);
  --brand-soft:var(--cl-accent-soft); --ico-bg:var(--cl-accent-soft);
  --radius:8px; --radius-sm:5px; --radius-lg:var(--cl-radius-card); --shadow:var(--cl-shadow-pop); --shadow-sm:none;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) body[data-page="collect"] #topbar,
  :root:not([data-theme="light"]) body[data-page="collect"] #routeView,
  :root:not([data-theme="light"]) .cl-page{
    --cl-canvas:hsl(222 18% 6%); --cl-card:hsl(222 14% 9%); --cl-card-2:hsl(222 12% 12%); --cl-field:hsl(222 12% 12%);
    --cl-row-hover:color-mix(in srgb,var(--cl-text-emphasis) 6%,transparent);
    --cl-row-sel:color-mix(in srgb,var(--brand-bright) 14%,transparent);
    --cl-border:hsl(222 10% 18%); --cl-border-subtle:hsl(222 10% 14%); --cl-border-strong:hsl(222 9% 26%);
    --cl-text-emphasis:hsl(220 20% 97%); --cl-text:hsl(220 10% 82%); --cl-text-subtle:hsl(220 9% 64%); --cl-text-muted:hsl(220 9% 58%);
    --cl-neg:#F87171; --cl-neg-soft:color-mix(in srgb,#F87171 16%,transparent);
    --cl-pos:#4ADE80; --cl-warn:#FBBF24; --cl-warn-soft:color-mix(in srgb,#FBBF24 14%,transparent);
    --cl-accent-hover:#F97316; --cl-accent-pressed:#EA6C0A; --cl-accent-text:#FB923C;
    --cl-accent-soft:color-mix(in srgb,var(--brand) 16%,transparent);
    --cl-accent-border:color-mix(in srgb,var(--brand-bright) 55%,transparent);
    --cl-accent-ring:color-mix(in srgb,var(--brand-bright) 30%,transparent);
    --cl-shadow-card:0 1px 2px rgba(0,0,0,.6);
    --cl-shadow-pop:0 8px 24px -6px rgba(0,0,0,.7),0 1px 2px rgba(0,0,0,.6);
    --cl-shadow-brand:0 1px 2px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.06);
    color-scheme:dark;   /* native checkboxes + scrollbars paint dark instead of white-on-black */
  }
}
:root[data-theme="dark"] body[data-page="collect"] #topbar,
:root[data-theme="dark"] body[data-page="collect"] #routeView,
:root[data-theme="dark"] .cl-page{
  --cl-canvas:hsl(222 18% 6%); --cl-card:hsl(222 14% 9%); --cl-card-2:hsl(222 12% 12%); --cl-field:hsl(222 12% 12%);
  --cl-row-hover:color-mix(in srgb,var(--cl-text-emphasis) 6%,transparent);
  --cl-row-sel:color-mix(in srgb,var(--brand-bright) 14%,transparent);
  --cl-border:hsl(222 10% 18%); --cl-border-subtle:hsl(222 10% 14%); --cl-border-strong:hsl(222 9% 26%);
  --cl-text-emphasis:hsl(220 20% 97%); --cl-text:hsl(220 10% 82%); --cl-text-subtle:hsl(220 9% 64%); --cl-text-muted:hsl(220 9% 58%);
  --cl-neg:#F87171; --cl-neg-soft:color-mix(in srgb,#F87171 16%,transparent);
  --cl-pos:#4ADE80; --cl-warn:#FBBF24; --cl-warn-soft:color-mix(in srgb,#FBBF24 14%,transparent);
  --cl-accent-hover:#F97316; --cl-accent-pressed:#EA6C0A; --cl-accent-text:#FB923C;
  --cl-accent-soft:color-mix(in srgb,var(--brand) 16%,transparent);
  --cl-accent-border:color-mix(in srgb,var(--brand-bright) 55%,transparent);
  --cl-accent-ring:color-mix(in srgb,var(--brand-bright) 30%,transparent);
  --cl-shadow-card:0 1px 2px rgba(0,0,0,.6);
  --cl-shadow-pop:0 8px 24px -6px rgba(0,0,0,.7),0 1px 2px rgba(0,0,0,.6);
  --cl-shadow-brand:0 1px 2px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.06);
  color-scheme:dark;
}

/* ── density follows the INPUT, not the width: a coarse pointer (tablet, gloved thumb) lifts every
      target to >= 40px. body.cl-touch is the harness debug hook because headless Brave does not
      emulate pointer:coarse — nothing in the app ever sets it. ── */
@media (pointer:coarse){
  body[data-page="collect"] #topbar, body[data-page="collect"] #routeView, .cl-page{
    --cl-h-ctl:40px; --cl-h-btn:44px; --cl-h-pill:40px; --cl-h-cust:64px; --cl-h-prop:52px; --cl-h-row:48px;
    --cl-h-opt:40px; --cl-w-check:48px; --cl-cb:20px; --cl-clear:40px; --cl-h-selbar:56px; --cl-h-search:44px; }
}
body.cl-touch[data-page="collect"] #topbar, body.cl-touch[data-page="collect"] #routeView, body.cl-touch .cl-page{
    --cl-h-ctl:40px; --cl-h-btn:44px; --cl-h-pill:40px; --cl-h-cust:64px; --cl-h-prop:52px; --cl-h-row:48px;
    --cl-h-opt:40px; --cl-w-check:48px; --cl-cb:20px; --cl-clear:40px; --cl-h-selbar:56px; --cl-h-search:44px; }
/* short screens (the 1200x582 landscape tablet): tighter chrome so the legend plus ~10 rows fit;
   targets never drop below 40 on coarse (the coarse step below wins by order) */
@media (max-height:700px){
  body[data-page="collect"] #topbar, body[data-page="collect"] #routeView, .cl-page{
    --cl-h-header:56px; --cl-h-search:40px; --cl-h-legend:32px; --cl-h-cust:54px; --cl-h-prop:44px; --cl-h-row:40px;
    --cl-gap:8px; }
}
@media (max-height:700px) and (pointer:coarse){ .cl-page{--cl-h-row:44px;--cl-h-prop:48px;--cl-h-cust:56px} }
@media (max-height:700px){ body.cl-touch .cl-page{--cl-h-row:44px;--cl-h-prop:48px;--cl-h-cust:56px} }

/* ── surfaces ── */
body[data-page="collect"] #routeView{background:var(--cl-canvas);padding-top:0}
.cl-page{font-family:var(--font-sans);color:var(--cl-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  width:100%;max-width:none;margin:0;padding:12px 0 0}
.cl-page-wide{max-width:none}   /* fills the lane: the header above and the cards below share BOTH edges */
.cl-page .pd-num,.cl-page .rt-count,.cl-cust-owed,.cl-prop-sum,.cl-page .rt-name{font-variant-numeric:tabular-nums}

/* ── header: the bar is the page's command line. Equal specificity with the ≤760 kit rules
      (app.css "mobile header"), so these win by ORDER: one fixed-height row, no wrap, no blur. ── */
body[data-page="collect"] #topbar{height:var(--cl-h-header);min-height:0;gap:20px;flex-wrap:nowrap;
  background:var(--cl-card);border-bottom:1px solid var(--cl-border);font-family:var(--font-sans);
  -webkit-backdrop-filter:none;backdrop-filter:none}
body[data-page="collect"] .gh-title{flex:0 1 auto;min-width:0}
body[data-page="collect"] .gh-title h1{font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--cl-text-emphasis)}
body[data-page="collect"] .gh-sub{display:none}
body[data-page="collect"] .gh-controls{flex:1 1 auto;min-width:0;flex-wrap:nowrap;margin:0;gap:0;justify-content:flex-end}
body[data-page="collect"] .gh-spacer{display:none}
body[data-page="collect"] .gh-actions{display:none}            /* no global search here; header.js leaves whitespace, so :empty would not match */
body[data-page="collect"] .gh-menu{width:40px;height:40px;border-radius:8px;border-color:var(--cl-border);background:var(--cl-card);color:var(--cl-text-subtle)}
@media (max-width:760px){
  body[data-page="collect"] #topbar{height:60px;padding-top:0;padding-bottom:0;gap:12px;row-gap:0;background:var(--cl-card)}
  body[data-page="collect"] .gh-title h1{font-size:17px;max-width:34vw}
}
@media (max-height:700px){ body[data-page="collect"] .gh-title h1{font-size:17px} }
@media (max-width:640px){ body[data-page="collect"] .gh-title{display:none} } /* menu + full-width search; the active nav item and the start card carry the name */

/* the search sits compact at the RIGHT of the bar (where the bell was) and widens a little while in
   use — the page title keeps the left. On a phone there is nothing else in the bar, so it fills it. */
#topbar .cl-search{flex:0 1 320px;width:320px;max-width:320px;
  transition:border-color .15s ease,box-shadow .15s ease,background .15s ease,flex-basis .2s ease,max-width .2s ease}
#topbar .cl-search:focus-within{flex-basis:400px;max-width:400px}
@media (max-width:640px){ #topbar .cl-search,#topbar .cl-search:focus-within{flex:1 1 auto;width:auto;max-width:none} }

/* ── the search (in #topbar; identical when rendered in-page as the no-header fallback) ── */
.cl-search{position:relative;display:flex;align-items:center;gap:8px;flex:1 1 640px;max-width:640px;min-width:0;height:var(--cl-h-search);
  padding:0 6px 0 12px;background:var(--cl-field);border:1px solid var(--cl-border);border-radius:var(--cl-radius-search);
  font-family:var(--font-sans);transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}
.cl-page > .cl-search{flex:none;margin:0 0 10px;max-width:none}
.cl-search:hover{border-color:var(--cl-border-strong)}
.cl-search:focus-within{background:var(--cl-card);border-color:var(--brand);box-shadow:0 0 0 3px var(--cl-accent-ring)}
.cl-search-ico{position:relative;flex:none;width:20px;height:20px;display:grid;place-items:center;color:var(--cl-text-muted)}
.cl-search-ico svg{transition:opacity .15s ease}
.cl-search:focus-within .cl-search-ico{color:var(--cl-text-emphasis)}
.cl-search input{flex:1;min-width:0;height:100%;border:0;outline:0;background:none;font:400 14px/1 var(--font-sans);
  color:var(--cl-text-emphasis);caret-color:var(--brand);-webkit-appearance:none;appearance:none}
.cl-search input::placeholder{color:var(--cl-text-muted)}
.cl-search input::-webkit-search-cancel-button,.cl-search input::-webkit-search-decoration{display:none;-webkit-appearance:none}
.cl-search-clear{flex:none;width:var(--cl-clear);height:var(--cl-clear);display:grid;place-items:center;border:0;background:none;
  border-radius:6px;color:var(--cl-text-subtle);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.cl-search-clear:hover{background:var(--cl-row-hover);color:var(--cl-text-emphasis)}
.cl-search-clear[hidden]{display:none}
.cl-search-kbd{display:none;flex:none;min-width:20px;height:20px;padding:0 5px;border:1px solid var(--cl-border);border-radius:4px;
  background:var(--cl-card);font:500 11px/18px var(--font-sans);color:var(--cl-text-muted);text-align:center}
@media (hover:hover) and (pointer:fine) and (min-width:1000px){
  .cl-search:not(:focus-within):not(:has(input:not(:placeholder-shown))) .cl-search-kbd{display:block} }
@media (pointer:coarse),(max-width:999px){ .cl-search input{font-size:16px} }   /* 16px: no iOS zoom-on-focus */
/* busy: the magnifier yields its box to the spinner the moment a key lands (existing .busy toggle) —
   feedback at keystroke time, not after the 280ms debounce, so a slow connection never looks dead */
.cl-search .cl-spin{position:absolute;inset:0;margin:auto;width:16px;height:16px;border-radius:50%;opacity:0;
  border:2px solid color-mix(in srgb,var(--cl-text-muted) 35%,transparent);border-top-color:var(--cl-text-emphasis)}
.cl-search.busy .cl-search-ico svg{opacity:0}
.cl-search.busy .cl-spin{opacity:1;animation:cl-spin .6s linear infinite}
@keyframes cl-spin{to{transform:rotate(360deg)}}

/* ── the bar: pills + tools (column at full height, one row when short) ── */
.cl-bar{display:flex;flex-direction:column;flex:none}
.cl-pills{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:2px 0;margin:0}
.cl-pill{display:inline-flex;align-items:center;min-height:var(--cl-h-pill);padding:0 14px;border:1px solid var(--cl-border);
  border-radius:999px;background:var(--cl-card);color:var(--cl-text);font:500 13px/1 var(--font-sans);white-space:nowrap;
  cursor:pointer;box-shadow:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  transition:background .12s ease,color .12s ease,border-color .12s ease}
@media (hover:hover){ .cl-pill:hover{border-color:var(--cl-border-strong);color:var(--cl-text-emphasis)} }
.cl-pill:active{background:var(--cl-card-2)}
.cl-pill.on{background:var(--cl-accent-soft);border-color:var(--cl-accent-border);color:var(--cl-accent-text);font-weight:600}
.cl-pill-sep{flex:none;width:1px;height:20px;margin:0 6px;background:var(--cl-border-strong)}
@container (max-width:760px){
  .cl-pills{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;
    mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent)}
  .cl-pills::-webkit-scrollbar{display:none}
}
/* a compact list (Customers / Parcels) has no bill rows, so no bill columns either; nor does a
   canvas holding only a state card (start / no match / error — collect.js .cl-state-only) */
.cl-page .rt-wrap.cl-compact thead,.cl-page .rt-wrap.cl-state-only thead{display:none}
.cl-toolrow{display:flex;align-items:center;gap:12px;height:40px;margin:10px 0 8px;border:0;flex:none}
.cl-toolrow .rt-count{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 13px/1 var(--font-sans);color:var(--cl-text-subtle)}
.cl-toolrow .rt-count b{font-weight:600;color:var(--cl-text-emphasis)}
.cl-toolrow .rt-tools{margin-left:auto;flex:none;display:flex;gap:8px}
/* short screens: pills (left) and count + tools (right) share ONE row. The pills selector carries
   the app-shell prefix because the height-chain block below pins it to flex:none at (0,3,1). When
   the row is short of space the PILLS give way — they scroll behind their fade and every pill is
   still reachable — while the count stays whole (its money is the point of the line); the count
   is capped so a long one can never starve the pills. */
@media (max-height:700px){
  .cl-bar{flex-direction:row;align-items:center;gap:12px}
  body[data-page="collect"] .cl-page .cl-bar .cl-pills,.cl-bar .cl-pills{flex:0 1 auto;min-width:0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;
    mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent)}
  .cl-bar .cl-pills::-webkit-scrollbar{display:none}
  body[data-page="collect"] .cl-page .cl-bar .cl-toolrow,.cl-bar .cl-toolrow{flex:1 1 auto;min-width:0;margin:0;height:var(--cl-h-ctl)}
  .cl-bar .cl-toolrow .rt-count{flex:0 1 auto;max-width:none}
  @container (max-width:1040px){
    .cl-page .cl-bar .rt-ico-btn{width:var(--cl-h-ctl);padding:0;justify-content:center}
    .cl-bar .cl-tool-lbl,.cl-bar .cl-tool-caret{display:none}
  }
}
/* tool buttons: labelled outline, icon-only on phones */
.cl-page .rt-ico-btn{position:relative;height:var(--cl-h-ctl);width:auto;min-width:var(--cl-h-ctl);padding:0 12px;gap:8px;
  border-radius:var(--cl-radius-ctl);border:1px solid var(--cl-border);background:var(--cl-card);color:var(--cl-text);
  font:500 13px/1 var(--font-sans);box-shadow:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.cl-page .rt-ico-btn svg{width:16px;height:16px} .cl-page .rt-ico-btn .cl-tool-caret{width:12px;height:12px;color:var(--cl-text-muted)}
.cl-page .rt-ico-btn:hover{background:var(--cl-row-hover);color:var(--cl-text-emphasis)}
.cl-page .rt-ico-btn.on{border-color:var(--cl-accent-border);color:var(--cl-accent-text);background:var(--cl-accent-soft)}
.cl-page .rt-ico-btn.on .cl-tool-caret{color:var(--cl-accent-text)}
.cl-page .rt-ico-btn.on::after{content:"";position:absolute;top:-3px;right:-3px;width:6px;height:6px;border-radius:50%;
  background:var(--brand);box-shadow:0 0 0 2px var(--cl-card)}   /* reads at arm's length: a scope other than "All" is on */
@container (max-width:600px){ .cl-page .rt-ico-btn{padding:0;width:40px;min-height:40px} .cl-tool-lbl,.cl-tool-caret{display:none} }
.cl-page .rt-pop-panel{top:calc(var(--cl-h-ctl) + 8px);min-width:200px;padding:6px;border-radius:var(--cl-radius-card);background:var(--cl-card);
  border-color:var(--cl-border);box-shadow:var(--cl-shadow-pop)}
.cl-page .rt-pop-label{padding:6px 10px 4px;font:600 11px/1 var(--font-sans);letter-spacing:.06em;text-transform:uppercase;color:var(--cl-text-muted)}
.cl-page .rt-opt{min-height:var(--cl-h-opt);padding:0 10px;border-radius:6px;font:400 13.5px/1.35 var(--font-sans);color:var(--cl-text)}
.cl-page .rt-opt:hover{background:var(--cl-row-hover)} .cl-page .rt-opt.on{font-weight:600;color:var(--cl-text-emphasis)}
.cl-page .rt-opt.on::after{background:var(--brand)} .cl-page .rt-opt-lock{opacity:.5}

/* ── canvas + cards: ONE table, gap rows + CSS edges. Every non-flat row's cells get the card
      bg and side edges; the row after a gap gets the top edge + radii, the row before a gap the
      bottom edge + radii. border-collapse:separate because td radii are ignored under collapse. ── */
.cl-page .rt-wrap{background:var(--cl-canvas);border:0;border-radius:0;box-shadow:none;scrollbar-gutter:stable}
.cl-page table.rt{border-collapse:separate;border-spacing:0;width:100%;font-family:var(--font-sans);font-size:13.5px}
.cl-page table.rt th{position:sticky;top:0;z-index:1;height:var(--cl-h-legend);padding:0 16px;background:var(--cl-canvas);
  box-shadow:inset 0 -1px 0 var(--cl-border);font:500 12px/1 var(--font-sans);letter-spacing:0;text-transform:none;color:var(--cl-text-subtle);border:0}
.cl-page table.rt th.on{color:var(--cl-text-emphasis);font-weight:600}   /* sorted column: weight, not orange */
.cl-page table.rt th .cl-sort{width:12px;height:12px;vertical-align:-2px;margin-left:4px}
.cl-page table.rt td{height:var(--cl-h-row);padding:0 16px;border:0;border-bottom:1px solid var(--cl-border-subtle);
  font-family:var(--font-sans);font-size:13.5px;font-weight:400;line-height:1.35;color:var(--cl-text);vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}
.cl-page table.rt tr.cl-flat td{height:auto;padding:0;border:0;background:transparent;max-width:none;white-space:normal;overflow:visible}
.cl-page table.rt tbody tr.cl-flat:hover td{background:transparent}
.cl-page table.rt tr.cl-gap td{height:var(--cl-gap)}
.cl-page table.rt tbody tr:not(.cl-flat) td{background:var(--cl-card)}
.cl-page table.rt tbody tr:not(.cl-flat) td:first-child{border-left:1px solid var(--cl-border)}
.cl-page table.rt tbody tr:not(.cl-flat) td:last-child{border-right:1px solid var(--cl-border)}
.cl-page table.rt tbody tr.cl-gap + tr:not(.cl-flat) td{border-top:1px solid var(--cl-border)}
.cl-page table.rt tbody tr.cl-gap + tr:not(.cl-flat) td:first-child{border-top-left-radius:var(--cl-radius-card)}
.cl-page table.rt tbody tr.cl-gap + tr:not(.cl-flat) td:last-child{border-top-right-radius:var(--cl-radius-card)}
.cl-page table.rt tbody tr:not(.cl-flat):has(+ tr.cl-gap) td,
.cl-page table.rt tbody tr:not(.cl-flat):last-child td{border-bottom:1px solid var(--cl-border)}
.cl-page table.rt tbody tr:not(.cl-flat):has(+ tr.cl-gap) td:first-child,
.cl-page table.rt tbody tr:not(.cl-flat):last-child td:first-child{border-bottom-left-radius:var(--cl-radius-card)}
.cl-page table.rt tbody tr:not(.cl-flat):has(+ tr.cl-gap) td:last-child,
.cl-page table.rt tbody tr:not(.cl-flat):last-child td:last-child{border-bottom-right-radius:var(--cl-radius-card)}
.cl-page table.rt tr.cl-section td{padding:8px 16px 0;font:500 12.5px/1 var(--font-sans);color:var(--cl-text-subtle)}
.cl-page table.rt tr.cl-more td{height:44px;text-align:center;font:400 13px/44px var(--font-sans);color:var(--cl-text-subtle)}

/* ── bill rows ── */
.cl-page table.rt tbody tr[data-id]{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.cl-page table.rt tbody tr[data-id]:nth-child(even){background:transparent}   /* the kit's nth-child zebra is off: header rows break its count */
/* alternating bill rows (collect.js marks every other bill under each property header, so each run starts the same);
   a tint of the ink over the card works in both themes; hover and selected still win */
.cl-page table.rt tbody tr.cl-alt td{background:color-mix(in srgb,var(--cl-text-emphasis) 3%,var(--cl-card))}
.cl-page table.rt tbody tr[data-id]:active td{background:var(--cl-row-hover)}
@media (hover:hover){ .cl-page table.rt tbody tr[data-id]:hover td{background:var(--cl-row-hover)} }
.cl-page table.rt tbody tr.cl-cust:hover td{background:var(--cl-card)}
.cl-page table.rt tbody tr.cl-subgrp:hover td{background:var(--cl-card-2)}
.cl-page table.rt tbody tr.sel td,.cl-page table.rt tbody tr.sel:hover td{background:var(--cl-row-sel)}
.cl-page table.rt tbody tr.sel td:first-child{box-shadow:inset 2px 0 0 var(--brand)}
.cl-page .inv-sel-h,.cl-page .inv-sel{width:var(--cl-w-check);min-width:var(--cl-w-check);padding:0;text-align:center}
.cl-page .inv-sel input,.cl-page .inv-sel-h input{-webkit-appearance:none;appearance:none;display:inline-block;width:var(--cl-cb);height:var(--cl-cb);margin:0;
  border:1.5px solid var(--cl-border-strong);border-radius:5px;background:var(--cl-card) center/12px 12px no-repeat;cursor:pointer;vertical-align:middle;
  transition:background-color .12s ease,border-color .12s ease}
@media (hover:hover){ .cl-page .inv-sel input:hover,.cl-page .inv-sel-h input:hover{border-color:var(--cl-text-muted)} }
.cl-page .inv-sel input:checked,.cl-page .inv-sel-h input:checked,.cl-page .inv-sel-h input:indeterminate{border-color:var(--brand);background-color:var(--brand)}
.cl-page .inv-sel input:checked,.cl-page .inv-sel-h input:checked{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E")}
.cl-page .inv-sel-h input:indeterminate{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E")}
.cl-page .inv-sel input:focus-visible,.cl-page .inv-sel-h input:focus-visible{outline:2px solid var(--cl-accent-ring);outline-offset:2px}
.cl-page .rt-name.rt-mono{font-family:var(--font-sans);font-size:13.5px;font-weight:500;color:var(--cl-text-emphasis)}
.cl-page table.rt td[data-label="Issued"],.cl-page table.rt td[data-label="Due"]{font-size:13px;color:var(--cl-text-subtle)}
.cl-page table.rt td.pd-num{text-align:right;font-variant-numeric:tabular-nums}
.cl-page table.rt td[data-label="Balance"]{font-weight:600;color:var(--cl-text-emphasis)}
/* status: dot + word, no fill — the word is the raw ledger status (collect.js STATUS_LABEL). map.css
   loads AFTER app.css and its filled .badge.paid/.due/.overdue/.void share (0,2,0) with a plain
   `.cl-page .badge`, so every rule here carries the table prefix to win. */
.cl-page table.rt .badge,.cl-page table.rt .badge:is(.paid,.due,.overdue,.void){display:inline-flex;align-items:center;gap:7px;padding:0;
  background:none;border-radius:0;font:500 12.5px/1 var(--font-sans);color:var(--cl-text);text-transform:capitalize}
.cl-page table.rt .badge::before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:var(--cl-text-muted)}
.cl-page table.rt .badge.overdue::before{background:var(--cl-neg)} .cl-page table.rt .badge.due::before{background:var(--cl-warn)} .cl-page table.rt .badge.paid::before{background:var(--cl-pos)}
.cl-page table.rt .badge.void{color:var(--cl-text-muted);text-decoration:line-through}
.cl-page table.rt tbody tr:nth-child(n+9){animation-delay:.16s}   /* cap the kit's stagger at 8 rows */
.cl-page table.rt tbody tr{animation-duration:.18s}

/* ── customer header: monogram · name + meta · what they owe ── */
.cl-page table.rt tr.rt-group td{height:auto;max-width:none;white-space:normal;overflow:visible;font-weight:400;text-overflow:clip}
.cl-page table.rt tr.rt-group td span{margin-left:0;font-weight:inherit;color:inherit}   /* (0,3,3): undo the kit's group-span rule */
.cl-page table.rt tr.rt-group td .cl-avatar{font-weight:600;color:var(--cl-text-subtle)}
.cl-page table.rt tr.rt-group td .cl-cust-meta,.cl-page table.rt tr.rt-group td .cl-prop-sum{font-weight:400;color:var(--cl-text-subtle)}
.cl-page table.rt tr.rt-group td .cl-parcel{font-weight:600;color:var(--cl-text-emphasis)}
.cl-page table.rt tr.cl-cust td{padding:12px 16px}
.cl-cust .cl-grp{display:flex;align-items:center;gap:12px;min-height:calc(var(--cl-h-cust) - 24px)}
.cl-avatar{flex:none;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--cl-card-2);
  border:1px solid var(--cl-border-subtle);color:var(--cl-text-subtle);font:600 12px/1 var(--font-sans);letter-spacing:.02em}
.cl-loose .cl-avatar{background:var(--cl-card-2);color:var(--cl-text-muted);border:1px dashed var(--cl-border-strong)}
.cl-cust-id{display:flex;flex-direction:column;gap:2px;min-width:0}
.cl-cust-name{display:inline-flex;align-items:center;gap:4px;min-width:0;font:600 15px/1.3 var(--font-sans);color:var(--cl-text-emphasis);text-decoration:none}
.cl-cust-name .cl-cust-go{flex:none;width:14px;height:14px;color:var(--cl-text-muted);transition:transform .12s ease}   /* always visible — no hover-only cue on touch */
/* a customer row opens the profile; a LINKED property row opens the parcel's details (collect.js openRow) */
.cl-page table.rt tbody tr.cl-open{cursor:pointer}
.cl-page table.rt tbody tr.cl-open:focus-visible{outline:2px solid var(--cl-accent-ring);outline-offset:-2px}
.cl-prop-title .cl-cust-go{transition:transform .12s ease}
@media (hover:hover){ .cl-page tr.cl-open:hover .cl-cust-name,.cl-page tr.cl-open:hover .cl-prop-txt{text-decoration:underline;text-underline-offset:3px} .cl-page tr.cl-open:hover .cl-cust-go{transform:translateX(2px)} }
.cl-loose .cl-cust-name{font-weight:500}
.cl-cust-meta{font:400 12.5px/1.35 var(--font-sans);color:var(--cl-text-subtle)}
.cl-cust-owed{margin-left:auto;flex:none;text-align:right;font-style:normal}
.cl-cust-owed.owing{display:flex;flex-direction:column;align-items:flex-end;gap:3px;font:600 17px/1.1 var(--font-sans);font-variant-numeric:tabular-nums;color:var(--cl-neg)}
.cl-cust-owed.owing small{font:500 11px/1 var(--font-sans);letter-spacing:.04em;color:var(--cl-text-muted)}
.cl-cust-owed.clear{display:inline-flex;align-items:center;gap:6px;font:600 13px/1 var(--font-sans);color:var(--cl-pos)}
.cl-cust-owed.clear svg{width:14px;height:14px}
@media (pointer:coarse){ .cl-cust-owed.owing{font-size:19px} .cl-cust-name{white-space:normal} }
body.cl-touch .cl-cust-owed.owing{font-size:19px} body.cl-touch .cl-cust-name{white-space:normal}
.cl-cust .cl-grp-act{margin-left:auto}            /* a loose group has no owed block: [Link] takes the right edge */
.cl-cust-owed + .cl-grp-act{margin-left:12px}

/* ── property sub-header: a grid that never wraps; the title ellipsises first, the button never
      leaves the address line (the one visible defect of the old flex-wrap strip on the tablet) ── */
.cl-page table.rt tr.cl-subgrp td{padding:0 16px 0 var(--cl-indent);background:var(--cl-card-2);border-top:1px solid var(--cl-border-subtle)}
.cl-subgrp .cl-grp{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;column-gap:12px;min-height:var(--cl-h-prop);padding:6px 0}
.cl-prop-title{display:flex;align-items:center;gap:6px;min-width:0;font:500 13.5px/1.35 var(--font-sans);color:var(--cl-text)}
.cl-prop-title svg{flex:none;width:14px;height:14px;color:var(--cl-text-muted)}
.cl-prop-txt{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cl-prop-title .cl-parcel{font-weight:600;color:var(--cl-text-emphasis)}
.cl-prop-sum{white-space:nowrap;font:400 12.5px/1 var(--font-sans);font-variant-numeric:tabular-nums;color:var(--cl-text-subtle)}
@container (max-width:640px){ .cl-prop-sum{display:none} }   /* phone: title + button fit; the rows below carry the amounts */
.cl-chip{display:inline-flex;align-items:center;flex:none;height:20px;padding:0 7px;border-radius:6px;font:600 11px/1 var(--font-sans);font-style:normal;white-space:nowrap;vertical-align:middle}
.cl-chip.warn{color:var(--cl-warn);background:var(--cl-warn-soft)}
/* a customer with nothing in the current filter */
.cl-page table.rt tr.cl-none td{height:40px;padding-left:var(--cl-indent);font-size:13px;color:var(--cl-text-subtle)}
.cl-page tr.cl-none svg{width:14px;height:14px;color:var(--cl-pos);vertical-align:-2px;margin-right:6px}

/* ── buttons: flat orange primary (the company's accent — the strongest colour on the page),
      outline secondary. `.cl-page .btn` (0,2,0) out-ranks plain `.btn-primary` (0,1,0), so the
      primary MUST restate its background or it renders white-on-white. ── */
.cl-page .btn{height:var(--cl-h-btn);padding:0 14px;border-radius:var(--cl-radius-ctl);border:1px solid var(--cl-border-strong);
  background:var(--cl-card);color:var(--cl-text-emphasis);font:600 13px/1 var(--font-sans);box-shadow:none;white-space:nowrap;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background .12s ease,border-color .12s ease}
.cl-page .btn:not(.btn-primary):hover{background:var(--cl-row-hover)} .cl-page .btn:not(.btn-primary):active{background:var(--cl-card-2)}
.cl-page .btn-primary{background:var(--brand);border-color:transparent;color:#fff;box-shadow:var(--cl-shadow-brand);filter:none}
.cl-page .btn-primary:hover{background:var(--cl-accent-hover);filter:none}
.cl-page .btn-primary:active{background:var(--cl-accent-pressed);transform:translateY(.5px)}
.cl-page .btn.cl-grp-act{padding:0 16px}
.cl-page .btn:disabled{opacity:.4;box-shadow:none}
:is(.cl-pill,.cl-page .btn,.cl-page .rt-ico-btn,.cl-cust-name,.cl-search-clear,.cl-page .rt-opt):focus-visible{outline:2px solid var(--cl-accent-ring);outline-offset:2px}

/* ── selection bar: a sticky action bar at the BOTTOM of the column (pure CSS, no DOM move —
      order:9 inside the #clBody flex column; .rt-wrap is the scroll box and shrinks to make room,
      so the bar never covers a row). Thumb-reachable on the tablet. ── */
.cl-page .inv-selbar{order:9;position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:10px;height:var(--cl-h-selbar);
  margin:10px 0 0;padding:0 12px 0 16px;background:var(--cl-card);border:1px solid var(--cl-border);border-radius:var(--cl-radius-card);
  box-shadow:var(--cl-shadow-pop);animation:cl-rise .16s ease both}
.cl-page .inv-selbar[hidden]{display:none}
.cl-page .inv-selbar-n{font:600 13px/1 var(--font-sans);color:var(--cl-text-emphasis);margin-right:auto}
@keyframes cl-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ── states: start / no match / error — one centred card on the canvas. A blank table reads as
      "broken" to staff who did not choose this app, so the pre-search state teaches what the
      search accepts. ── */
.cl-page td.cl-state-cell{padding:0;border:0}
.cl-state{display:flex;flex-direction:column;align-items:center;gap:6px;max-width:520px;margin:48px auto;padding:40px 28px;text-align:center;
  background:var(--cl-card);border:1px solid var(--cl-border);border-radius:var(--cl-radius-card);box-shadow:var(--cl-shadow-card);line-height:1.5}
.cl-state-ico{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:var(--cl-accent-soft);color:var(--brand);margin-bottom:4px}
.cl-state-ico.muted{width:44px;height:44px;background:var(--cl-card-2);color:var(--cl-text-muted)}
.cl-state-ico.neg{width:44px;height:44px;background:var(--cl-neg-soft);color:var(--cl-neg)}
.cl-state b{font:600 16px/1.3 var(--font-sans);color:var(--cl-text-emphasis)} .cl-state.sm b{font-size:14px;font-weight:500}
.cl-state-hint{font-size:13.5px;color:var(--cl-text-subtle);max-width:44ch}
.cl-state b,.cl-state-hint{text-wrap:balance}
.cl-page #clBody:has(> .rt-wrap.cl-state-only) .cl-toolrow .rt-tools{display:none}   /* the tools return with the first result */
.cl-start-eg{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:8px}
.cl-start-eg i{display:inline-flex;align-items:center;height:28px;padding:0 10px;font:500 12px/1 var(--font-sans);font-style:normal;color:var(--cl-text-subtle);
  background:var(--cl-card-2);border:1px solid var(--cl-border-subtle);border-radius:999px}
.cl-state-kbd{display:none;margin-top:10px;font-size:12px;color:var(--cl-text-muted)} .cl-state-kbd kbd{font:inherit;padding:1px 5px;border:1px solid var(--cl-border);border-radius:4px}
@media (hover:hover) and (pointer:fine) and (min-width:1000px){ .cl-state-kbd{display:block} }
.cl-state .btn{margin-top:10px}
@media (max-height:700px){ .cl-state{margin:24px auto;padding:28px} }

/* ── loading: one card of shimmering bars (the SHAPE of the answer), rows held dim while the next
      scope loads — blanking reads as a crash on slow wifi ── */
.cl-sk-row td{height:var(--cl-h-row)} .cl-sk{display:block;height:10px;border-radius:5px;width:62%;background:var(--cl-border-subtle);
  background-image:linear-gradient(90deg,transparent,color-mix(in srgb,var(--cl-text-emphasis) 7%,transparent),transparent);background-size:200% 100%;animation:cl-sheen 1.1s linear infinite}
.cl-sk-row td:nth-child(odd) .cl-sk{width:44%} @keyframes cl-sheen{to{background-position:-200% 0}}
.cl-busy{opacity:.55;transition:opacity .12s ease;pointer-events:none}
@media (prefers-reduced-motion:reduce){ .cl-page *,.cl-page *::before,.cl-search *{animation:none!important;transition:none!important} .cl-search .cl-spin{border-top-color:var(--cl-text-emphasis)} }

/* ============================================================
   Collect — THE APP-SHELL HEIGHT CHAIN and container queries (unchanged mechanism).
   The route view becomes a full-height flex column and the canvas is the only part
   that grows, so the pills, tools and the sticky legend stay pinned no matter how
   tall the chrome above them turns out to be. Measuring in CSS beats guessing a
   --chrome constant per breakpoint. nav.js stamps body[data-page].
   ============================================================ */
.cl-page{container-type:inline-size}   /* children query THIS box's width — the sidebar collapses at 900px,
                                          so the same window gives the content two very different widths */
body[data-page="collect"] .main{height:100vh;height:100dvh;min-height:0}
body[data-page="collect"] #routeView{
  flex:1 1 auto;min-height:0;height:auto;
  display:flex;flex-direction:column;overflow:auto;padding-bottom:0
}
body[data-page="collect"] .cl-page{flex:1;min-height:0;display:flex;flex-direction:column}
body[data-page="collect"] .cl-page > #clBody{flex:1;min-height:0;display:flex;flex-direction:column}
/* ONLY the canvas flexes. Everything above it is flex:none — otherwise the default
   flex-shrink:1 quietly squashes the pills and tools to fit. (The search is NOT in this
   list any more: it lives in #topbar, compact at the right; the in-page fallback
   has its own `.cl-page > .cl-search{flex:none}`.) */
body[data-page="collect"] .cl-page .cl-bar,
body[data-page="collect"] .cl-page .cl-pills,
body[data-page="collect"] .cl-page .cl-toolrow,
body[data-page="collect"] .cl-page .inv-selbar{flex:none}
/* the canvas is the flexible part; min-height:0 lets it actually shrink */
body[data-page="collect"] .cl-page .rt-wrap{flex:1 1 auto;min-height:132px}
.cl-page .rt-wrap{
  overflow:auto;                                   /* both axes — x for wide tables, y for rows */
  overscroll-behavior:contain;                     /* don't chain the scroll to the page */
}

/* ── the 750px-wide portrait case: the kit HIDES the Columns popover
      below 760px (map.css `.rt-pop:has(> [id$="ColsBtn"])`), which would
      silently remove the custom-columns feature on that exact tablet.
      Put it back for this page — there is room, and it is the point. ── */
@media (max-width:760px){
  .cl-page .rt-pop:has(> #clColsBtn){display:block}
  /* the shared kit reflows its toolbar for PHONES under 760px — and that fires on the
     750px portrait tablet, where there is plenty of room. Undo the three parts that
     would break the merged row: the row must not wrap (a wrapped row doubles in height
     and hands back the whole vertical saving), the tools must not claim width:100%
     (which pushed the tabs and count clean off the row), and the count must keep its
     source order instead of the kit's order:2 (which put it after the tools). */
  .cl-page .cl-toolrow{flex-wrap:nowrap}
  .cl-page .cl-toolrow .rt-tools{width:auto;flex:none;flex-wrap:nowrap;margin-left:auto}
  .cl-page .cl-toolrow .rt-count{order:0;margin-left:0}
}

/* ============================================================
   Collect — NARROW SCREENS (<=640px). KEEP THE TABLE A TABLE. The kit card-ifies rows
   below 640px (thead hidden, each row a 2-col grid keyed on data-label). That is right
   for a phone list, wrong here: this page IS the multi-column table — a collector
   compares number, status and balance across rows. Restore real table layout and let
   .rt-wrap scroll sideways, which it already does. Cell padding tightens to 12px.
   ============================================================ */
@media (max-width:640px){
  .cl-page table.rt thead{display:table-header-group}
  .cl-page table.rt{display:table;width:auto;min-width:100%}
  .cl-page table.rt tbody{display:table-row-group}
  .cl-page table.rt tbody tr,
  .cl-page table.rt tbody tr[data-id],
  .cl-page table.rt tbody tr[data-i]{display:table-row;padding:0;border-bottom:0}
  .cl-page table.rt td{display:table-cell;padding:0 12px;border-bottom:1px solid var(--cl-border-subtle);
    white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis;font-size:13.5px}
  .cl-page table.rt th{padding:0 12px}
  /* every column the kit hid on phones comes back — that is the point of this page */
  .cl-page table.rt td[data-label]{display:table-cell}
  .cl-page table.rt td[data-label="Name"],.cl-page table.rt td[data-label="Parcel"],
  .cl-page table.rt td[data-label="Number"],.cl-page table.rt td[data-label="Status"],
  .cl-page table.rt td[data-label="EHub #"],.cl-page table.rt td[data-label="Owner"],
  .cl-page table.rt td[data-label="Customer"],.cl-page table.rt td[data-label="Balance"],
  .cl-page table.rt td[data-label="Address"]{grid-area:auto;justify-self:auto;font-size:13.5px;font-weight:inherit}
  .cl-page table.rt td[data-label="Number"]{color:var(--cl-text-emphasis);font-weight:500}
  .cl-page table.rt td[data-label="Balance"]{font-weight:600}
  .cl-page table.rt td[data-label="Issued"],.cl-page table.rt td[data-label="Due"]{font-size:13px}
  .cl-page table.rt tbody tr[data-id]:has(td.inv-sel){position:static;padding-left:0}
  .cl-page table.rt td.inv-sel{position:static;display:table-cell;width:var(--cl-w-check);padding:0}
  .cl-page table.rt tr.rt-group td{padding:0 12px 0 var(--cl-indent);max-width:none;white-space:normal}
  .cl-page table.rt tr.cl-cust td{padding:12px}
  .cl-page table.rt tr.cl-flat td{padding:0;border:0;max-width:none;white-space:normal}
  .cl-page table.rt tr.cl-section td{padding:8px 12px 0}
  .cl-page .cl-state-cell{white-space:normal !important;max-width:none !important}
  .cl-page .inv-selbar{flex-wrap:nowrap}
  .cl-page .inv-selbar .btn-primary{max-width:46vw;overflow:hidden;text-overflow:ellipsis}
  .cl-page .cl-toolrow{gap:8px}
}

/* ============================================================
   Collect — COLLAPSED NAV. With the sidebar hidden, --nav-gap still reserves 72px
   for a rail that isn't on screen, so the page floated in a dead left gutter. The
   only thing actually occupying that space is the fixed 46px menu button — and it
   belongs NEXT TO the page title, not in a lane of its own. So: the header reserves
   exactly the button, and the content below runs to the edge.
   ============================================================ */

/* the header's menu button: hidden by default so no other page changes — it only takes
   over where the page opts in (see the collect rules above). */
/* ── The menu button, APP-WIDE ──────────────────────────────────────────────
   Rule: a page WITH a header owns its menu button inside that header, styled like
   every other header control (see .gh-search-btn). A page WITHOUT a header — the map —
   keeps the floating navy #navOpen, because there it sits over content and has to
   read as a floating affordance rather than a bar control.
   This also retires the old trick of overlaying the fixed button on the header at
   `left:10px; top:5px` (app.css ~2341): a 38px button at top:5 centres at 24px
   inside a 64px bar, i.e. 8px high on EVERY headered page. In flow, the header's
   own align-items:center does it exactly. ── */
.gh-menu{display:none;flex:none;align-items:center;justify-content:center;width:40px;height:40px;
  border:1px solid var(--border);border-radius:10px;background:var(--surface);
  color:var(--text-subheading);cursor:pointer;transition:background .15s,color .15s}
.gh-menu:hover{background:var(--surface-2);color:var(--text-heading)}
/* shown wherever there IS a header and the sidebar is collapsed; the floating one stands down */
body.has-header.nav-collapsed .gh-menu{display:inline-flex}
body.has-header.nav-collapsed #navOpen{display:none}
/* with the button in the bar, the ~84px lane that was reserved for a hidden sidebar is
   dead space — reclaim it for the header AND the content so the two stay aligned */
body.has-header.nav-collapsed #topbar{padding-left:14px}
body.has-header.nav-collapsed #routeView{padding-left:14px}

/* ============================================================
   Collect — ONE gutter, shared by the header and the content.
   Before: #topbar padded 264/24 while #routeView padded 252/14, so the page title
   and the table it labels sat on different vertical lines, and the right edge was
   two different numbers. Now both derive from --cl-gutter, and the left one simply
   adds the sidebar lane WHEN a sidebar is actually on screen — collapsed, it is the
   plain gutter, with no leftover lane for a rail that isn't there.
   ============================================================ */
body[data-page="collect"]{--cl-gutter:16px}
@media (min-width:1000px){ body[data-page="collect"]{--cl-gutter:24px} }
body[data-page="collect"] #topbar,
body[data-page="collect"] #routeView{
  padding-left:calc(var(--nav-gap) + var(--cl-gutter));
  padding-right:var(--cl-gutter)}
body[data-page="collect"].nav-collapsed #topbar,
body[data-page="collect"].nav-collapsed #routeView{padding-left:var(--cl-gutter)}
/* the page itself adds nothing horizontally — stacked paddings are what put the header
   and the table on different edges in the first place */
body[data-page="collect"] .cl-page{padding-left:0;padding-right:0;padding-top:12px;padding-bottom:12px}
@media (max-width:640px){ body[data-page="collect"]{--cl-gutter:12px} }
@media (max-height:700px){ body[data-page="collect"] .cl-page{padding-top:8px;padding-bottom:8px} }

/* ============================================================
   PROFILE v3 (2026-10-07) — a HERO + PILLS. The hero: who, what they owe, settle it. Below it one
   panel at a time (Bills · Property & businesses · Activity) — an empty section costs no space and
   the open list gets the whole width. Nucleus surfaces, company orange. The page scrolls normally
   (in the overlay the console itself scrolls) — no nested scrolling lanes any more.
   ============================================================ */
.pd{display:flex;flex-direction:column;gap:12px;min-height:0;font-family:var(--font-sans);color:var(--cal-text)}
.rp .pd,#routeView .pd{flex:1}

/* ── the hero: identity, the money, the action — everything once ── */
.pf-hero{position:relative;display:grid;grid-template-columns:minmax(280px,1fr) auto auto;align-items:center;gap:14px 22px;padding:16px 20px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--brand) 10%,var(--cal-bg)),var(--cal-bg) 60%);
  border:1px solid var(--cal-border-subtle);border-radius:14px;box-shadow:var(--shadow-card)}
.pd-who{display:flex;align-items:center;gap:13px;min-width:0}
.pd-avatar{flex:none;width:46px;height:46px;border-radius:13px;display:grid;place-items:center;
  background:linear-gradient(160deg,var(--brand),var(--brand-deep));color:#fff;font-weight:700;font-size:1rem;letter-spacing:.02em;
  box-shadow:0 6px 16px -8px color-mix(in srgb,var(--brand) 70%,transparent)}
.pd-who-t{min-width:0}
.pd-who-t h2{margin:0;font-size:1.15rem;font-weight:700;letter-spacing:-.015em;line-height:1.2;color:var(--cal-text-emphasis);overflow-wrap:break-word}
/* every identifier is LABELLED — a clerk has to match what the resident is reading off a paper bill */
.pd-creds{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;margin-top:4px}
.pd-cred{display:inline-flex;align-items:baseline;gap:5px;font-size:.78rem;color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums}
.pd-cred i{font-style:normal;font-size:.66rem;font-weight:500;color:var(--cal-text-muted)}
.pd-cred a{color:var(--brand);text-decoration:none}
.pd-moreid{background:none;border:0;padding:0;font:inherit;font-size:.72rem;font-weight:600;color:var(--brand);cursor:pointer}
.pd-moreid:hover{text-decoration:underline}
.pd-idstrip{display:flex;flex-wrap:wrap;gap:6px 20px;background:var(--cal-bg-muted);
  border:1px solid var(--cal-border-subtle);border-radius:var(--radius-xl);padding:10px 16px}

/* the money IS the standing — there is no second badge anywhere */
.pd-money{display:flex;flex-direction:column;align-items:flex-end;gap:2px;text-align:right}
.pd-money-k{font-size:.62rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--cal-text-muted)}
.pd-money-v{font-size:1.7rem;line-height:1.05;font-weight:700;letter-spacing:-.025em;
  font-variant-numeric:tabular-nums;color:var(--cal-text-emphasis)}
.pd-money-v.owing{color:var(--bad)}
/* a clear account looks QUIET — no colour, no chips, no shouting $0.00 */
.pd-money-v:not(.owing){font-size:1.1rem;font-weight:600}
.pd-split{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;margin-top:4px}
.pd-chip{font-style:normal;font-size:.68rem;color:var(--cal-text-subtle);background:var(--cal-bg);
  border:1px solid var(--cal-border-subtle);border-radius:999px;padding:1px 8px}
.pd-chip b{font-weight:600;color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums}
.pd-lastpaid{font-size:.68rem;color:var(--cal-text-subtle);font-variant-numeric:tabular-nums;margin-top:2px}
.pd-act{display:flex;align-items:center;gap:6px;flex:none}
.pd-pay{min-height:40px;padding:0 16px;font-size:.86rem;font-variant-numeric:tabular-nums}
.pd3 .pd-act .rd-iconbtn{width:36px;height:36px;border-radius:9px} /* the pencil / X sit level with the smaller Receive */

.pd-reconcile{margin:0;padding:9px 14px;font-size:.78rem;color:var(--cal-text-subtle);
  background:color-mix(in srgb, var(--warn) 8%, var(--cal-bg));
  border:1px solid color-mix(in srgb, var(--warn) 34%, var(--cal-border-subtle));border-radius:var(--radius-xl)}
.pd-reconcile b{color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums}

/* ── the pills: each carries its count and what matters (open · owed / parcels · businesses) ── */
.pf-tabs{display:flex;flex-wrap:wrap;gap:6px;padding:2px 2px 0}
.pf-tab{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:0 14px;border:1px solid var(--cal-border);border-radius:999px;
  background:var(--cal-bg);color:var(--cal-text);font-family:inherit;font-size:.8rem;font-weight:600;cursor:pointer;
  transition:background .15s,color .15s,border-color .15s,box-shadow .15s}
.pf-tab:hover{background:var(--cal-bg-muted)}
.pf-tab:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 35%,transparent)}
.pf-tab.on{background:var(--cal-text-emphasis);border-color:var(--cal-text-emphasis);color:var(--cal-bg)}
.pf-tab-n{font-style:normal;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--cal-bg-subtle);color:var(--cal-text-subtle);font-size:.68rem;font-weight:700;text-align:center;font-variant-numeric:tabular-nums}
.pf-tab.on .pf-tab-n{background:color-mix(in srgb,var(--cal-bg) 22%,transparent);color:var(--cal-bg)}
.pf-tab-sub{font-style:normal;font-weight:500;font-size:.72rem;color:var(--cal-text-subtle);font-variant-numeric:tabular-nums}
.pf-tab-sub.bad{color:var(--bad)}
.pf-tab.on .pf-tab-sub{color:color-mix(in srgb,var(--cal-bg) 78%,transparent)}
.pf-tab.on .pf-tab-sub.bad{color:#FCA5A5}

/* ── the panel: one card, full width ── */
.pd-panel{background:var(--cal-bg);border:1px solid var(--cal-border-subtle);border-radius:14px;box-shadow:var(--shadow-card);overflow:hidden}
.pd-panel[hidden]{display:none}
.pd-panel-h{display:flex;align-items:center;gap:10px;padding:9px 14px;border-bottom:1px solid var(--cal-border-subtle);background:var(--cal-bg-muted)}
.pd-panel-k{font-size:.76rem;font-weight:600;color:var(--cal-text-subtle)}
.pd-panel-sum{margin-left:auto;font-size:.82rem;font-weight:700;color:var(--bad);font-variant-numeric:tabular-nums}
/* Open / Paid switch */
.pd-seg{display:inline-flex;gap:3px;padding:2px;border-radius:999px;background:var(--cal-bg-subtle)}
.pd-seg-b{display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:0 11px;border:0;border-radius:999px;background:transparent;
  color:var(--cal-text-subtle);font-family:inherit;font-size:.76rem;font-weight:600;cursor:pointer}
.pd-seg-b.on{background:var(--cal-bg);color:var(--cal-text-emphasis);box-shadow:var(--shadow-card)}
.pd-seg-b i{font-style:normal;font-size:.7rem;font-variant-numeric:tabular-nums;opacity:.8}
.pd-list[hidden]{display:none}

/* rows: room to read — number, department and date on the left; standing, money and Pay on the right */
.pd-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;
  min-height:52px;padding:9px 14px;background:none;border:0;border-bottom:1px solid var(--cal-border-subtle);
  font-family:inherit;text-align:left;cursor:pointer}
.pd-row:last-child{border-bottom:0}
.pd-row:hover{background:var(--cal-bg-muted)}
.pd-row.od{box-shadow:inset 3px 0 0 var(--bad)}   /* overdue reads as an edge, not another pill */
.pd-row-l{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.pd-row-l b{font-size:.86rem;font-weight:600;color:var(--cal-text-emphasis);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pd-row-l span{font-size:.72rem;color:var(--cal-text-subtle);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pd-row-amt{flex:none;min-width:80px;text-align:right;font-size:.9rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--cal-text-emphasis)}
.pd-row-amt.owing{color:var(--bad)}
.pd-row-amt.clear{color:var(--cal-text-muted);font-weight:500}
.pd-row-paid .pd-row-l b{color:var(--cal-text)}
.pd-tag{flex:none;display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;font-size:.66rem;font-weight:700;
  background:var(--cal-bg-subtle);color:var(--cal-text-subtle);white-space:nowrap}
.pd-tag.bad{background:color-mix(in srgb,var(--bad) 12%,transparent);color:var(--bad)}
.pd-tag.ok{background:color-mix(in srgb,var(--ok) 13%,transparent);color:var(--ok)}
.pd-tag.warn{background:color-mix(in srgb,var(--warn) 14%,transparent);color:var(--warn)}
/* pay THIS bill / THIS parcel — the chip is secondary to the row, primary to nothing */
.pd-paychip{flex:none;display:inline-flex;align-items:center;min-height:30px;padding:0 12px;
  border:1px solid var(--brand);border-radius:7px;color:var(--brand);
  font-size:.74rem;font-weight:600;cursor:pointer;transition:background .12s ease}
.pd-paychip:hover{background:var(--brand-soft)}
.pd-state{font-weight:600;color:var(--cal-text-subtle)}
.pd-state.bad{color:var(--bad)}
/* an empty panel says what would be here, and what to do — never a blank card */
.pd-empty{display:flex;flex-direction:column;align-items:center;gap:5px;padding:34px 20px;text-align:center;color:var(--cal-text-subtle);font-size:.82rem}
.pd-empty b{font-size:.92rem;font-weight:600;color:var(--cal-text-emphasis)}
.pd-empty span{max-width:440px;line-height:1.45}
.pd-link{margin-top:6px;background:none;border:0;padding:0;font:inherit;font-size:.8rem;font-weight:600;color:var(--brand);cursor:pointer}
.pd-link:hover{text-decoration:underline}
.pd-showmore{display:block;width:100%;padding:11px;border:0;border-top:1px solid var(--cal-border-subtle);background:var(--cal-bg-muted);
  color:var(--brand);font-family:inherit;font-size:.78rem;font-weight:600;cursor:pointer}
.pd-showmore:hover{background:var(--cal-bg-subtle)}

/* activity: read, not acted on — but no longer squeezed into a rail */
.pd-ev{display:flex;gap:10px;padding:9px 14px;cursor:pointer;border-bottom:1px solid var(--cal-border-subtle)}
.pd-ev:last-of-type{border-bottom:0}
.pd-ev:hover{background:var(--cal-bg-muted)}
.pd-ev-dot{flex:none;width:7px;height:7px;border-radius:50%;margin-top:6px;background:var(--cal-text-muted)}
.pd-ev-dot.pay{background:var(--ok)} .pd-ev-dot.edit{background:var(--brand)} .pd-ev-dot.bad{background:var(--bad)}
.pd-ev-c{min-width:0;display:flex;flex-direction:column;gap:2px}
.pd-ev-line{font-size:.8rem;color:var(--cal-text);overflow-wrap:anywhere}
.pd-ev-line b{font-weight:600;color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums}
.pd-ev-meta{font-size:.7rem;color:var(--cal-text-muted)}
/* grouped operations */
.pd-ev-grp{align-items:center}
.pd-ev-n{flex:none;margin-left:auto;font-style:normal;font-size:.66rem;font-weight:700;
  padding:1px 7px;border-radius:999px;background:var(--cal-bg-subtle);color:var(--cal-text-subtle)}
.pd-ev-sub{padding-left:38px;background:var(--cal-bg-muted)}

/* overlay mode: the console itself scrolls under the "< Home" back button; the sheet is the frame.
   ONLY while open — without .open this rule out-ranked .ov{display:none} and a closed profile stayed on screen */
.ov-full.open:has(.pd){display:flex;flex-direction:column}
.ov-sheet > .pd3{flex:1;min-height:0;overflow-y:auto;padding:0 20px 28px}
.rp-back.pd-ovback{flex:none;align-self:flex-start;width:auto;max-width:none;margin:0;min-height:40px;padding:12px 20px 0;
  background:none;border:0;font-family:inherit;cursor:pointer}
/* page mode (#residents/<id>, resident.html): the page scrolls like any other. overflow-x:clip — the drill-in
   slide (.page-in translateX) otherwise leaves a stale strip of horizontal scroll (clip, not hidden: no scroll container) */
#routeView:has(.pd){overflow-x:clip}
#routeView:has(.pd) .res-page{padding-bottom:28px}
main.rp:has(.pd){overflow-x:clip}

/* ── tablet (landscape) and narrow desktop: identity on its own row; the money and the action share the next ── */
@media (max-width:1100px){
  .pf-hero{grid-template-columns:minmax(0,1fr) auto;gap:12px 20px}
  .pf-hero .pd-who{grid-column:1/-1}
  .pd-money{align-items:flex-start;text-align:left}
  .pd-split{justify-content:flex-start}
}
/* ── narrow / portrait: the hero stacks, Receive spans the width, rows wrap money + Pay onto their own line ── */
@media (max-width:760px){
  .pf-hero{grid-template-columns:1fr;gap:12px;padding:14px 14px}
  .pd-money{align-items:flex-start;text-align:left}
  .pd-split{justify-content:flex-start}
  .pd-act{width:100%;flex-wrap:wrap}
  .pd-pay{flex:1 1 100%}
  .pd-row{flex-wrap:wrap;row-gap:6px;padding:10px 12px}
  .pd-row-l{flex:1 1 100%}
  .pd-row-amt{margin-left:auto;min-width:0}
  .pd-paychip{min-height:36px;padding:0 14px}  /* gloved thumbs on the portrait tablet */
  .pd-panel-h{padding:10px 14px}
  .pd-ev{padding:12px 14px}
  .ov-sheet > .pd3{padding:0 12px 20px}
}

/* statement scope chooser — pick WHAT before how */
.pd-stsheet{max-width:440px}
.pd-stopts{display:flex;flex-direction:column;gap:8px}
.pd-stopt{display:flex;align-items:flex-start;gap:10px;padding:11px 13px;cursor:pointer;
  border:1px solid var(--cal-border-subtle);border-radius:var(--radius-xl);background:var(--cal-bg)}
.pd-stopt:hover{background:var(--cal-bg-muted)}
.pd-stopt.on{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 10%,var(--cal-bg))} /* same fix as .mg-opt.on: --brand-soft is light on the dark theme */
.pd-stopt input{margin-top:3px;accent-color:var(--brand);flex:none}
.pd-stopt span{display:flex;flex-direction:column;gap:1px;min-width:0}
.pd-stopt b{font-size:.86rem;font-weight:600;color:var(--cal-text-emphasis)}
.pd-stopt em{font-style:normal;font-size:.74rem;color:var(--cal-text-subtle)}
@media (max-width:640px){ .pd-stopt{padding:13px} }

/* ── Merge lots (merge-lots.js): WHICH lots · WHICH ONE survives (or the new #) · their BILLS — one sheet ── */
.mg-sheet{max-width:640px}
.mg-sec{padding:14px 0;border-top:1px solid var(--cal-border-subtle)}
.mg-sec:first-child{border-top:0;padding-top:0}
.mg-sec h4{display:flex;align-items:baseline;gap:8px;margin:0 0 8px;font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--cal-text-muted)}
.mg-sec h4 em{font-style:normal;font-weight:500;letter-spacing:0;text-transform:none;font-size:.74rem;color:var(--cal-text-subtle)}
.mg-opts{display:flex;flex-direction:column;gap:8px}
.mg-opt{display:flex;align-items:flex-start;gap:10px;padding:11px 13px;cursor:pointer;
  border:1px solid var(--cal-border-subtle);border-radius:var(--radius-xl);background:var(--cal-bg)}
.mg-opt:hover{background:var(--cal-bg-muted)}
/* a picked row is a brand TINT of the panel, not the light --brand-soft (that token isn't remapped for dark — it turned
   picked rows cream under near-white text) */
.mg-opt.on{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 10%,var(--cal-bg))}
.mg-opt.off{opacity:.55;cursor:default}
.mg-opt input{margin-top:3px;accent-color:var(--brand);flex:none}
.mg-opt > span{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
.mg-opt b{font-size:.86rem;font-weight:600;color:var(--cal-text-emphasis)}
.mg-opt em{font-style:normal;font-size:.74rem;color:var(--cal-text-subtle)}
.mg-opt .mg-owed{flex:none;font-style:normal;font-size:.84rem;font-weight:600;color:var(--bad);font-variant-numeric:tabular-nums}
.mg-opt .mg-tag{flex:none;font-style:normal;align-self:center;padding:1px 8px;border-radius:999px;background:var(--cal-bg-subtle);color:var(--cal-text-subtle);font-size:.66rem;font-weight:700}
.mg-new{display:grid;grid-template-columns:150px 1fr;gap:10px;margin-top:8px;padding-left:34px}
.mg-sum{margin:0;font-size:.8rem;color:var(--cal-text-subtle);line-height:1.5}
.mg-sum b{color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums}
.mg-sum + .mg-sum{margin-top:4px}
.mg-note{margin:8px 0 0;padding:9px 12px;font-size:.76rem;line-height:1.45;color:var(--cal-text-subtle);
  background:color-mix(in srgb,var(--warn) 8%,var(--cal-bg));border:1px solid color-mix(in srgb,var(--warn) 34%,var(--cal-border-subtle));border-radius:var(--radius-xl)}
.mg-confirm{padding:14px 16px;font-size:.86rem;line-height:1.55;color:var(--cal-text);
  background:color-mix(in srgb,var(--warn) 8%,var(--cal-bg));border:1px solid color-mix(in srgb,var(--warn) 40%,var(--cal-border-subtle));border-radius:var(--radius-xl)}
.mg-confirm b{color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums}
.mg-done{display:flex;flex-direction:column}
.mg-line{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--cal-border-subtle);font-size:.84rem;color:var(--cal-text)}
.mg-line:last-child{border-bottom:0}
.mg-line b{color:var(--cal-text-emphasis);font-variant-numeric:tabular-nums;text-align:right}
.mg-line.ok b{color:var(--ok)}
@media (max-width:640px){ .mg-new{grid-template-columns:1fr;padding-left:0} .mg-opt{padding:13px} }

/* ── Payments page (#payments, payments.js): "My payments" — the signed-in person's own report.
   Period pills + actions, four totals, then the payments grouped by business day (a row opens its bill).
   Rows are a grid on wide screens and two-line cards on phones. ── */
.py-page{max-width:1100px;margin:0 auto;padding:2px 0 40px;display:flex;flex-direction:column;gap:16px}
.py-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px}
.py-pills{display:flex;flex-wrap:wrap;gap:6px}
.py-pill{min-height:36px;padding:0 14px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-body);font-family:inherit;font-size:.84rem;font-weight:600;cursor:pointer;touch-action:manipulation;transition:background .15s,border-color .15s,color .15s}
.py-pill:hover{border-color:color-mix(in srgb,var(--text-heading) 30%,var(--border))}
.py-pill.on{background:var(--text-heading);border-color:var(--text-heading);color:var(--surface)}
.py-custom{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.py-custom[hidden]{display:none}
.py-custom label{display:flex;align-items:center;gap:6px;font-size:.78rem;font-weight:600;color:var(--text-hint)}
.py-custom .input{width:auto;height:36px;padding:0 10px;font-size:.86rem}
.py-acts{display:flex;gap:8px;margin-left:auto}
.py-acts .btn:disabled{opacity:.5;cursor:not-allowed}
.py-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.py-stat{min-width:0;padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}
.py-stat > span{display:block;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text-hint)}
.py-stat b{display:block;margin-top:4px;font-size:1.5rem;font-weight:800;line-height:1.2;letter-spacing:-.01em;color:var(--text-heading);font-variant-numeric:tabular-nums}
.py-stat.is-total b{color:var(--ok)} /* not `.main` — that's the app shell's full-height column */
.py-stat small{display:block;margin-top:2px;font-size:.76rem;color:var(--text-hint)}
.py-methods{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:8px;font-size:.88rem;font-weight:700;color:var(--text-heading);font-variant-numeric:tabular-nums}
.py-methods i{font-style:normal;font-weight:600;color:var(--text-hint)}
.py-skel b,.py-skel > .py-stat > span{background:var(--surface-3);border-radius:6px;color:transparent}
.py-day{overflow:hidden;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}
.py-day + .py-day{margin-top:12px}
.py-stats + .py-day,.py-stats + .py-empty{margin-top:16px}
.py-day-h{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;padding:12px 16px;background:var(--surface-2);border-bottom:1px solid var(--border)}
.py-day-h b{font-size:.92rem;color:var(--text-heading)}
.py-day-h span{font-size:.8rem;color:var(--text-hint);font-variant-numeric:tabular-nums}
.py-day-h strong{color:var(--text-heading)}
.py-row{display:grid;grid-template-columns:72px minmax(0,1fr) auto 128px;align-items:center;gap:14px;width:100%;padding:12px 16px;border:0;border-top:1px solid var(--border);background:none;color:var(--text-body);font-family:inherit;font-size:var(--fs-body);text-align:left;cursor:pointer;transition:background .12s}
.py-day-h + .py-row{border-top:0}
.py-row:hover{background:var(--surface-2)}
.py-row:focus-visible{outline:2px solid var(--brand-bright);outline-offset:-2px}
.py-time{font-size:.82rem;color:var(--text-hint);font-variant-numeric:tabular-nums}
.py-main{min-width:0;display:flex;flex-direction:column}
.py-main b{font-weight:600;color:var(--text-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.py-main small{font-size:.76rem;color:var(--text-hint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.py-meth{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px 6px}
.py-meth small{flex-basis:100%;text-align:right;font-size:.72rem;color:var(--text-hint)}
.py-chip{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:999px;background:var(--surface-3);color:var(--text-body);font-size:.72rem;font-weight:700;white-space:nowrap}
.py-chip.disc{background:color-mix(in srgb,var(--bad) 12%,transparent);color:var(--bad)}
.py-chip.void{background:color-mix(in srgb,var(--text-hint) 18%,transparent);color:var(--text-hint)}
.py-amt{text-align:right;font-weight:800;color:var(--text-heading);font-variant-numeric:tabular-nums;white-space:nowrap}
.py-amt.disc{font-weight:700;color:var(--bad)}
.py-empty{padding:36px 20px;text-align:center;background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius-lg);color:var(--text-hint);font-size:.88rem}
.py-empty b{display:block;margin-bottom:4px;font-size:1rem;color:var(--text-heading)}
.py-loading{border-style:solid}
/* printed report: signature lines under the totals */
.py-sign{display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-top:46px;font-size:.78rem;color:var(--text-hint)}
.py-sign span{display:block;height:1px;margin-bottom:6px;background:var(--text-heading)}
@media (max-width:900px){.py-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){
  .py-acts{margin-left:0}
  .py-stat b{font-size:1.25rem}
  .py-row{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"main amt" "time meth";row-gap:4px;column-gap:10px;padding:12px 14px}
  .py-main{grid-area:main}
  .py-amt{grid-area:amt}
  .py-time{grid-area:time}
  .py-meth{grid-area:meth}
  .py-meth small{flex-basis:auto}
}

/* ── first paint without a flash of the wrong tabs (nav.js + perms.js) ──
   Until permissions are known and the first route has run, the page views and the menu links stay invisible:
   body.route-pending (set in app.html, removed by the first route) and #sidebar.nav-pending (added by nav.js
   only when the device doesn't remember the user's permissions yet). The delayed animation reveals them anyway
   if the scripts never get that far, so a broken load can't leave a blank app. */
body.route-pending #mapView,body.route-pending #routeView,#sidebar.nav-pending .side-nav{visibility:hidden;animation:ehub-reveal 0s linear 4s forwards}
@keyframes ehub-reveal{to{visibility:visible}}

/* ── the burial overlay (burial.js EHubBurial) — one shared sheet for a cemetery lot: its status, who is
   buried there, and each burial's record (create / details / edit). A CEMETERY parcel is not a property
   record — no owner, value or tax. Here (not map.css) so any page can open it. ── */
.cm-sheet{max-width:600px}
.cm-head{align-items:flex-start;gap:12px}
.cm-head-l{flex:1 1 auto;display:flex;align-items:flex-start;gap:12px;min-width:0}
.cm-head>.ov-x{flex:none} /* a long name squeezes the title, never the close button */
.cm-head-t{min-width:0}
.cm-back{flex:none;margin:3px -2px 0 -6px;border-color:transparent;background:transparent}
.cm-ico{flex:none;width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--cem-available) 16%,var(--surface));color:var(--cem-available-ink)}
.cm-head h3{display:flex;align-items:center;flex-wrap:wrap;gap:8px;overflow-wrap:anywhere}
.cm-meta{margin-top:3px;font-size:var(--fs-hint);color:var(--text-hint)}
.cm-crumb{display:inline-flex;align-items:center;gap:2px;padding:0;border:none;background:none;color:var(--text-hint);font:inherit;cursor:pointer}
.cm-crumb:hover{color:var(--brand)}
.cm-crumb svg{width:14px;height:14px}
.cm-kind{display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;border:1px solid var(--border);font-size:.7rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-hint)}
.cm-pill{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;font-size:.74rem;font-weight:700}
.cm-pill::before{content:"";width:8px;height:8px;border-radius:2px;background:currentColor}
.cm-pill.is-available{background:color-mix(in srgb,var(--cem-available) 16%,var(--surface));color:var(--cem-available-ink)}
.cm-pill.is-reserved{background:color-mix(in srgb,var(--cem-reserved) 15%,var(--surface));color:var(--cem-reserved-ink)}
.cm-pill.is-occupied{background:color-mix(in srgb,var(--cem-occupied) 16%,var(--surface));color:var(--cem-occupied-ink)}
.cm-sec{margin-bottom:24px}
.cm-sec:last-child{margin-bottom:0}
.cm-sec-h{display:flex;align-items:center;gap:8px;margin-bottom:10px;font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-hint)}
.cm-count{min-width:22px;padding:1px 7px;border-radius:999px;background:var(--surface-3);color:var(--text-body);font-size:.72rem;letter-spacing:0;text-align:center}
/* status: a three-way switch; Occupied is never tapped — recording a burial sets it */
.cm-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.cm-seg-b{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 10px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--text-body);font:inherit;font-size:.9rem;font-weight:600;cursor:pointer}
.cm-seg-b i{flex:none;width:10px;height:10px;border-radius:3px}
.cm-seg-b.is-available i{background:var(--cem-available)}.cm-seg-b.is-reserved i{background:var(--cem-reserved)}.cm-seg-b.is-occupied i{background:var(--cem-occupied)}
.cm-seg-b:not(:disabled):hover{background:var(--surface)}
.cm-seg-b.on{background:var(--surface);border-color:var(--border);box-shadow:var(--shadow-sm);color:var(--text-heading)}
.cm-seg-b:disabled{cursor:default}
.cm-seg-b:disabled:not(.on){opacity:.45}
.cm-seg-b:focus-visible{outline:none;border-color:var(--brand-bright);box-shadow:0 0 0 3px rgba(249,115,22,.18)}
.cm-res-form{display:flex;flex-direction:column;gap:12px;margin-top:14px}
.cm-res{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin-top:12px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);font-size:.88rem}
.cm-res .k{font-size:var(--fs-hint);font-weight:600;color:var(--text-hint)}
.cm-res .v{font-weight:600;color:var(--text-heading)}
.cm-res .n{flex-basis:100%;font-size:var(--fs-hint);color:var(--text-hint)}
.cm-res .ph{white-space:nowrap}
.cm-link{margin-left:auto;padding:0;border:none;background:none;color:var(--brand);font:inherit;font-weight:600;cursor:pointer}
.cm-res-act{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px}
.cm-res-act .cm-inline-err{flex:1 1 200px;margin:0;min-height:0}
.cm-inline-err{margin-top:10px;min-height:0}
.cm-hint{margin-top:8px;font-size:var(--fs-hint);color:var(--text-hint)}
/* who is buried here: one row per burial, tap for the record */
.cm-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.cm-row{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--text-body);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s,background .15s}
.cm-row:hover{border-color:color-mix(in srgb,var(--cem-occupied) 40%,var(--border));background:var(--surface-2)}
.cm-row:focus-visible{outline:none;border-color:var(--brand-bright);box-shadow:0 0 0 3px rgba(249,115,22,.18)}
.cm-row-ico{flex:none;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--cem-occupied) 13%,var(--surface));color:var(--cem-occupied-ink)}
.cm-row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.cm-row-main b{font-size:.95rem;color:var(--text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cm-row-main span{font-size:var(--fs-hint);color:var(--text-hint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cm-row-tag{flex:none;display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;background:var(--surface-3);color:var(--text-hint);font-size:.74rem;font-weight:600}
.cm-row-tag svg{width:13px;height:13px}
.cm-row-chev{flex:none;display:flex;color:var(--text-hint)}
.cm-empty{margin-bottom:10px;padding:16px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--text-hint);font-size:.9rem;text-align:center}
.cm-add{width:100%;justify-content:center;min-height:46px}
.cm-add:disabled{opacity:.5;cursor:not-allowed}
/* one burial's record */
.cm-kvs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
.cm-kv{display:flex;flex-direction:column;gap:3px;min-width:0}
.cm-kv.wide{grid-column:1/-1}
.cm-kv .k{font-size:.72rem;font-weight:600;color:var(--text-hint)}
.cm-kv .v{font-size:.95rem;color:var(--text-body);overflow-wrap:anywhere;white-space:pre-line}
.cm-files{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.cm-file{display:inline-flex;align-items:center;max-width:100%;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);font-size:.8rem;font-weight:500}
.cm-file.is-new{gap:6px;padding-left:10px;border-style:dashed;color:var(--text-body)}
.cm-file a{display:inline-flex;align-items:center;gap:6px;min-width:0;padding:5px 10px;color:var(--text-body);text-decoration:none}
.cm-file a:hover{color:var(--brand)}
.cm-file span{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cm-file-x{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin-right:2px;border:none;border-radius:50%;background:none;color:var(--text-hint);cursor:pointer}
.cm-file-x:hover{background:var(--surface-3);color:var(--bad)}
.cm-file-x svg{width:13px;height:13px}
.cm-by{margin-top:4px;font-size:.75rem;color:var(--text-hint)}
.cm-foot{align-items:center}
.cm-foot-sp{flex:1}
.cm-danger{color:var(--bad)}
/* record / edit form */
.cm-form{display:flex;flex-direction:column;gap:14px}
.cm-form textarea.input{resize:vertical;min-height:64px}
.cm-drop{display:flex;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:12px;border:1.5px dashed var(--border);border-radius:var(--radius);background:var(--surface-2);color:var(--text-body);font-size:.88rem;font-weight:600;cursor:pointer}
.cm-drop:hover{border-color:var(--brand-bright);color:var(--brand)}
.cm-drop-sm{min-height:46px;margin-top:12px}
.cm-drop.is-busy{opacity:.65;pointer-events:none} /* uploading / saving: no second pick racing the first */
.cm-form-foot{flex-wrap:wrap;align-items:center}
.cm-foot-err{flex:1 1 220px;margin:0;min-height:0} /* beside Save, so a validation message is always on screen */
.cm-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:40px 10px;color:var(--text-hint);text-align:center}
.cm-spin{width:26px;height:26px;border:3px solid var(--border);border-top-color:var(--brand-bright);border-radius:50%;animation:cm-spin .8s linear infinite}
.cm-spin-sm{flex:none;width:16px;height:16px;border-width:2px}
@keyframes cm-spin{to{transform:rotate(360deg)}}
@media (max-width:560px){.cm-seg-b{font-size:.84rem;padding:8px 6px}.cm-kvs{grid-template-columns:1fr}}
/* burial overlay — the lot's location (centre, size, corners, Google Maps) */
.cm-mono{font-family:var(--mono);font-size:.88em;font-variant-numeric:tabular-nums}
.cm-loc-act{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px}
.cm-loc-act .cm-loc-ll{color:var(--text-body)}
.cm-maps{text-decoration:none}
.cm-corners{margin-top:12px;font-size:var(--fs-hint);color:var(--text-hint)}
.cm-corners summary{cursor:pointer;font-weight:600;color:var(--text-body)}
.cm-corners ol{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:4px}
.cm-corners li{display:flex;justify-content:space-between;gap:12px;padding:6px 10px;border-radius:8px;background:var(--surface-2)}
.cm-corners li b{font-family:var(--mono);font-weight:500;color:var(--text-body);font-variant-numeric:tabular-nums}
/* Residents: the next A-Z page (residents.js renderMore) */
.rt-more{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:16px 0 8px}
.rt-more:empty{display:none}
.rt-more-hint{font-size:var(--fs-hint);color:var(--text-hint)}
/* Receive: bills left out because their property isn't linked to a parcel (payment-overlay.js heldOutHTML) */
.po-held{display:flex;flex-direction:column;gap:3px;margin:10px 0;padding:10px 12px;border:1px solid color-mix(in srgb,var(--warn) 45%,var(--border));border-radius:var(--radius);background:color-mix(in srgb,var(--warn) 8%,var(--surface));font-size:.8rem;color:var(--text-body)}
.po-held b{color:var(--text-heading);font-size:.84rem}
.po-held span{color:var(--text-hint)}
/* burial overlay — a family plot's slots (numbered badges, tap to open), and a slot's plot banner */
.cm-slot-n{font-weight:700;font-size:.9rem}
.cm-slot-n.is-available{background:color-mix(in srgb,var(--cem-available) 16%,var(--surface));color:var(--cem-available-ink)}
.cm-slot-n.is-reserved{background:color-mix(in srgb,var(--cem-reserved) 15%,var(--surface));color:var(--cem-reserved-ink)}
.cm-slot-n.is-occupied{background:color-mix(in srgb,var(--cem-occupied) 16%,var(--surface));color:var(--cem-occupied-ink)}
.cm-row > .cm-pill{flex:none}
.cm-plotbar{display:flex;align-items:center;gap:12px;width:100%;margin-bottom:18px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--cem-reserved) 40%,var(--border));border-radius:var(--radius);background:color-mix(in srgb,var(--cem-reserved) 7%,var(--surface));color:var(--text-body);font:inherit;text-align:left;cursor:pointer}
.cm-plotbar:hover{background:color-mix(in srgb,var(--cem-reserved) 12%,var(--surface))}
.cm-plotbar .cm-row-ico{background:color-mix(in srgb,var(--cem-reserved) 15%,var(--surface));color:var(--cem-reserved-ink)}
.cm-plotbar .cm-row-main b{font-size:.9rem}
/* ── Send for signature ──────────────────────────────────────────────────────────────────────────────────────
   On the certificate (cert-stage.js .cert-sig-N): each signature sits on its line, its foot on the rule. The
   lines' text starts at top 682px; the underscores fall about 17px lower. */
.cert-stage .cert-sig{top:612px;height:84px;width:auto;max-width:270px;object-fit:contain;object-position:center bottom;transform:translateX(-50%);pointer-events:none}
.cert-stage .cert-sig[hidden]{display:none}
.cert-stage .cert-sig-1{left:202.9px}
.cert-stage .cert-sig-2{left:507.9px}
.cert-stage .cert-sig-3{left:819.1px}
/* the certificate page's signing panel (trade-certificate.js renderSigning), at the top of the form */
.sg-panel{display:flex;flex-direction:column;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.sg-panel[hidden]{display:none}
.sg-panel .cert-fieldhint{margin-top:0}
.sg-send{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.sg-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sg-chip{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;font-size:.74rem;font-weight:700}
.sg-chip.is-pending{background:color-mix(in srgb,var(--warn) 15%,transparent);color:var(--warn)}
.sg-chip.is-signed{background:color-mix(in srgb,var(--ok) 14%,transparent);color:var(--ok)}
.sg-count{font-size:var(--fs-hint);color:var(--text-hint);font-variant-numeric:tabular-nums}
.sg-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.sg-list li{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:9px;padding:7px 10px;border-radius:8px;background:var(--surface-2);font-size:var(--fs-hint)}
.sg-dot{width:8px;height:8px;border-radius:50%;background:var(--warn)}
.sg-list li.is-signed .sg-dot{background:var(--ok)}
.sg-who{min-width:0;display:flex;flex-direction:column;color:var(--text-body)}
.sg-who b{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-hint)}
.sg-when{color:var(--text-hint);white-space:nowrap}
.sg-list li.is-signed .sg-when{color:var(--ok);font-weight:600}
.sg-acts{display:flex;flex-wrap:wrap;gap:8px}
.sg-msg{margin:0;font-size:var(--fs-hint);color:var(--text-hint)}
.sg-msg:empty{display:none}
.sg-msg.bad{color:var(--bad);font-weight:600}
.sg-picks{display:flex;flex-direction:column;gap:12px;margin-top:14px}
.sg-warn{padding:8px 10px;border-radius:8px;background:color-mix(in srgb,var(--warn) 10%,transparent);color:var(--text-body)}
/* Settings › Trade Licenses — the certificate signers (settings-trade.js) */
.ts-wrap{max-width:760px;display:flex;flex-direction:column;gap:12px}
.ts-intro{margin:0}
.ts-card{overflow:hidden;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}
.ts-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,300px);align-items:center;gap:16px;padding:14px 16px;border-top:1px solid var(--border)}
.ts-row:first-child{border-top:0}
.ts-meta{min-width:0;display:flex;flex-direction:column;gap:2px}
.ts-meta b{color:var(--text-heading)}
.ts-meta span{font-size:var(--fs-hint);color:var(--text-hint)}
.ts-pick{display:flex;flex-direction:column;gap:4px}
.ts-pick small{font-size:var(--fs-small);color:var(--text-hint);min-height:1em}
.ts-warn{margin:0;padding:10px 12px;border-radius:var(--radius);background:color-mix(in srgb,var(--warn) 10%,transparent);color:var(--text-body);font-size:var(--fs-hint)}
@media (max-width:620px){.ts-row{grid-template-columns:1fr;gap:8px}}
/* Send for signature sheet: the configured signers, confirmed (trade-certificate.js openSend) */
.sg-confirm{list-style:none;margin:14px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.sg-confirm li{display:grid;grid-template-columns:120px minmax(0,1fr);align-items:center;gap:12px;padding:10px 12px;border-radius:var(--radius);background:var(--surface-2)}
.sg-confirm li > b{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-hint)}
.sg-confirm li span{min-width:0;display:flex;flex-direction:column;color:var(--text-heading);font-weight:600}
.sg-confirm li small{font-weight:400;font-size:var(--fs-hint);color:var(--text-hint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-change{margin-top:10px;padding:0;border:0;background:none;color:var(--brand);font:inherit;font-size:var(--fs-hint);font-weight:600;cursor:pointer}
.sg-change:hover{text-decoration:underline}
/* ════════════════════════════════════════════════════════════════════════════════════════════════════════════
   THE SIGNER'S HOME (#signatures — signatures.js). For the Mayor, the Director and the Board Member: calm, roomy,
   few words. The look is folio's recipe (Inter, warm-neutral flat surfaces, 8% hairlines, soft tinted badges,
   overlapping signer avatars, a staggered entrance) with THIS app's orange as the one accent.
   Tokens are scoped to the route's bar, its canvas and the viewer — never body — and remap the app's own names
   (--surface, --border, --text-…), so everything inside re-skins itself and no other page changes.
   ════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
body[data-page="signatures"] #topbar,
body[data-page="signatures"] #routeView,
.sgv{
  --sg-font:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --bg:var(--gray-2); --surface:#fffffe; --surface-2:var(--gray-1); --surface-3:var(--gray-3); --field-bg:#fffffe; /* greys: theme.css --gray-* */
  --border:var(--gray-4);
  --text-heading:#1a1a1f; --text-body:#374151; --text-subheading:#374151; --text-hint:#6b7280; --text:#374151; --text-muted:#9ca3af;
  --sg-faint:#9ca3af;
  --sg-ok:#10b981; --sg-ok-ink:#0b7a55; --sg-ok-soft:rgba(16,185,129,.11);
  --sg-warn-ink:#b45309; --sg-warn-soft:rgba(245,158,11,.13);
  --sg-accent-ink:#9a3412; --sg-accent-soft:color-mix(in srgb,var(--brand) 9%,transparent);
  --sg-hero-a:color-mix(in srgb,var(--brand) 9%,#fffffe); --sg-hero-b:color-mix(in srgb,#f59e0b 7%,#fffffe);
  --sg-shadow-card:0 1px 3px rgba(0,0,0,.05); --sg-shadow-pop:0 8px 24px rgba(0,0,0,.08);
  --radius:10px; --radius-sm:8px; --radius-lg:14px;
  --shadow:var(--sg-shadow-pop); --shadow-sm:var(--sg-shadow-card);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) body[data-page="signatures"] #topbar,
  :root:not([data-theme="light"]) body[data-page="signatures"] #routeView,
  :root:not([data-theme="light"]) .sgv{
    --bg:#0f0f0f; --surface:#171717; --surface-2:#1f1f1f; --surface-3:#2b2b2b; --field-bg:#171717;
    --border:rgba(255,255,255,.1);
    --text-heading:#fafafa; --text-body:#d4d4d4; --text-subheading:#d4d4d4; --text-hint:#a3a3a3; --text:#d4d4d4; --text-muted:#737373;
    --sg-faint:#737373;
    --sg-ok-ink:#34d399; --sg-ok-soft:rgba(16,185,129,.16);
    --sg-warn-ink:#fbbf24; --sg-warn-soft:rgba(245,158,11,.16);
    --sg-accent-ink:#fb923c; --sg-accent-soft:color-mix(in srgb,var(--brand-bright) 15%,transparent);
    --sg-hero-a:color-mix(in srgb,var(--brand) 14%,#171717); --sg-hero-b:color-mix(in srgb,#f59e0b 6%,#171717);
    --sg-shadow-card:0 1px 3px rgba(0,0,0,.5); --sg-shadow-pop:0 8px 24px rgba(0,0,0,.55);
    color-scheme:dark;
  }
}
:root[data-theme="dark"] body[data-page="signatures"] #topbar,
:root[data-theme="dark"] body[data-page="signatures"] #routeView,
:root[data-theme="dark"] .sgv{
  --bg:#0f0f0f; --surface:#171717; --surface-2:#1f1f1f; --surface-3:#2b2b2b; --field-bg:#171717;
  --border:rgba(255,255,255,.1);
  --text-heading:#fafafa; --text-body:#d4d4d4; --text-subheading:#d4d4d4; --text-hint:#a3a3a3; --text:#d4d4d4; --text-muted:#737373;
  --sg-faint:#737373;
  --sg-ok-ink:#34d399; --sg-ok-soft:rgba(16,185,129,.16);
  --sg-warn-ink:#fbbf24; --sg-warn-soft:rgba(245,158,11,.16);
  --sg-accent-ink:#fb923c; --sg-accent-soft:color-mix(in srgb,var(--brand-bright) 15%,transparent);
  --sg-hero-a:color-mix(in srgb,var(--brand) 14%,#171717); --sg-hero-b:color-mix(in srgb,#f59e0b 6%,#171717);
  --sg-shadow-card:0 1px 3px rgba(0,0,0,.5); --sg-shadow-pop:0 8px 24px rgba(0,0,0,.55);
  color-scheme:dark;
}

/* ── people who ONLY sign get no sidebar (it would hold one item): the slim bar carries the brand and their
      avatar, as in folio. nav.js sets body.signer-home (the Signatory role: Signatures, no collections Home). ── */
body.signer-home #sidebar, body.signer-home #navOpen{display:none !important}
body.signer-home, body.signer-home.nav-collapsed{--nav-gap:0px}
body.signer-home[data-page="signatures"] #topbar{padding-left:20px;padding-right:20px}
body.signer-home[data-page="signatures"] #routeView{padding-left:20px;padding-right:20px}
body.signer-home[data-page="signatures"] .gh-title,
body.signer-home[data-page="signatures"] .gh-menu{display:none !important}

/* ── the bar: 56px, brand left, live dot and the person right ── */
body[data-page="signatures"].has-header #topbar{height:56px;min-height:0;gap:12px;flex-wrap:nowrap;background:var(--surface);
  border-bottom:1px solid var(--border);font-family:var(--sg-font);-webkit-backdrop-filter:none;backdrop-filter:none}
body[data-page="signatures"] #routeView{background:var(--bg);padding-top:0;min-height:calc(100vh - 56px)}
body[data-page="signatures"] .gh-title h1{font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--text-heading)}
body[data-page="signatures"] .gh-controls{flex:1 1 auto;min-width:0;flex-wrap:nowrap;gap:10px;justify-content:flex-end}
body[data-page="signatures"] .gh-actions{display:none}
.sgb-brand{display:none;align-items:center;gap:10px;color:var(--text-heading);font-size:16px;font-weight:700;letter-spacing:-.01em;text-decoration:none;white-space:nowrap}
.sgb-brand b{font-weight:700;color:var(--brand)}
.sgb-logo{width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:var(--brand);color:#fff}
body.signer-home .sgb-brand{display:inline-flex}
.sgb-sp{flex:1}
.sgb-live{display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 11px;border-radius:999px;background:var(--sg-ok-soft);color:var(--sg-ok-ink);font-size:12px;font-weight:600;white-space:nowrap}
.sgb-live i{position:relative;width:7px;height:7px;border-radius:50%;background:var(--sg-ok)}
.sgb-live i::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--sg-ok);opacity:0;animation:sgb-ping 2.4s ease-out infinite}
@keyframes sgb-ping{0%{transform:scale(.4);opacity:.7}70%,100%{transform:scale(1.25);opacity:0}}
.sgb-userwrap{display:none;position:relative}
body.signer-home .sgb-userwrap{display:block}
.sgb-user{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 10px 0 4px;border:1px solid transparent;border-radius:999px;background:none;color:var(--text-body);font:500 14px/1 var(--sg-font);cursor:pointer;transition:background .15s,border-color .15s}
.sgb-user:hover,.sgb-user[aria-expanded="true"]{background:var(--surface-2);border-color:var(--border)}
.sgb-av{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--brand);color:#fff;font-size:12px;font-weight:700;letter-spacing:.02em}
.sgb-user svg{color:var(--sg-faint)}
.sgb-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:300;min-width:230px;padding:6px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:var(--sg-shadow-pop);animation:sgb-drop .18s ease}
.sgb-menu[hidden]{display:none}
@keyframes sgb-drop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.sgb-menu-h{display:flex;flex-direction:column;gap:1px;padding:8px 10px 10px;border-bottom:1px solid var(--border);margin-bottom:6px}
.sgb-menu-h b{font-size:14px;font-weight:600;color:var(--text-heading)}
.sgb-menu-h small{font-size:12px;color:var(--text-hint);overflow:hidden;text-overflow:ellipsis}
.sgb-menu button{display:flex;align-items:center;gap:10px;width:100%;height:40px;padding:0 10px;border:0;border-radius:8px;background:none;color:var(--text-body);font:500 14px/1 var(--sg-font);cursor:pointer}
.sgb-menu button:hover{background:var(--surface-2);color:var(--text-heading)}
@media (max-width:640px){
  .sgb-uname,.sgb-user svg{display:none}
  .sgb-user{padding:0 4px}
  .sgb-live span{display:none}
  .sgb-live{padding:0 10px}
}

/* ── the page ── */
.sgh{max-width:1120px;margin:0 auto;padding:28px 4px 80px;display:flex;flex-direction:column;gap:20px;
  font-family:var(--sg-font);color:var(--text-body);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.sgh-enter > *{animation:sg-in .55s cubic-bezier(.22,1,.36,1) backwards} /* `backwards`, not `both`: a kept transform would trap fixed children */
.sgh-enter > *:nth-child(2){animation-delay:.06s}
.sgh-enter > *:nth-child(3){animation-delay:.12s}
.sgh-enter > *:nth-child(4){animation-delay:.18s}
.sgh-enter > *:nth-child(5){animation-delay:.24s}
@keyframes sg-in{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.sgh-enter > *,.sgb-menu,.sgb-live i::after{animation:none}}

.sgh-welcome{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap}
.sgh-welcome h1{margin:0;font-size:28px;font-weight:700;letter-spacing:-.025em;line-height:1.15;color:var(--text-heading)}
.sgh-welcome p{margin:5px 0 0;font-size:14px;color:var(--text-hint)}
.sgh-seg{display:inline-flex;padding:3px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
.sgh-seg button{height:32px;padding:0 14px;border:0;border-radius:7px;background:none;color:var(--text-hint);font:500 13px/1 var(--sg-font);cursor:pointer;transition:background .15s,color .15s}
.sgh-seg button.on{background:var(--sg-accent-soft);color:var(--sg-accent-ink);font-weight:600}
.sgh-note{margin:-6px 0 0;padding:10px 14px;border-radius:10px;background:var(--sg-ok-soft);color:var(--sg-ok-ink);font-size:13.5px;font-weight:500}
.sgh-note:empty{display:none}
.sgh-note.bad{background:color-mix(in srgb,var(--bad) 10%,transparent);color:var(--bad)}

/* the hero: what to do, and the one button that does it */
.sgh-hero{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:16px;padding:20px 22px;
  border:1px solid color-mix(in srgb,var(--brand) 22%,transparent);border-radius:16px;
  background:linear-gradient(135deg,var(--sg-hero-a) 0%,var(--sg-hero-b) 100%)}
.sgh-hero-ico{width:48px;height:48px;display:flex;align-items:center;justify-content:center;border-radius:14px;background:var(--brand);color:#fff;
  box-shadow:0 6px 16px -6px color-mix(in srgb,var(--brand) 70%,transparent)}
.sgh-hero-text{min-width:0;display:flex;flex-direction:column;gap:3px}
.sgh-hero-text b{font-size:18px;font-weight:600;letter-spacing:-.015em;color:var(--text-heading)}
.sgh-hero-text span{font-size:14px;color:var(--text-hint)}
.sgh-hero.is-clear{border-color:var(--border);background:var(--surface);box-shadow:var(--sg-shadow-card)}
.sgh-hero.is-clear .sgh-hero-ico{background:var(--sg-ok-soft);color:var(--sg-ok-ink);box-shadow:none}
.sg-cta{display:inline-flex;align-items:center;justify-content:center;gap:9px;height:48px;padding:0 24px;border:0;border-radius:12px;
  background:var(--brand);color:#fff;font:600 15px/1 var(--sg-font);letter-spacing:-.005em;white-space:nowrap;cursor:pointer;
  box-shadow:0 1px 2px rgba(0,0,0,.14),inset 0 1px 0 rgba(255,255,255,.2);transition:transform .15s ease,box-shadow .15s ease,background .15s ease}
.sg-cta:hover:not(:disabled){transform:translateY(-1px);background:var(--brand-bright);box-shadow:0 8px 20px -6px color-mix(in srgb,var(--brand) 65%,transparent),inset 0 1px 0 rgba(255,255,255,.2)}
.sg-cta:active:not(:disabled){transform:none}
.sg-cta:focus-visible,.sgh-row:focus-visible,.sgb-user:focus-visible,.sgv-back:focus-visible,.sgv-nav:focus-visible{outline:2px solid var(--brand-bright);outline-offset:2px}
.sg-cta:disabled{background:var(--surface-3);color:var(--sg-faint);box-shadow:none;cursor:not-allowed}

.sgh-cols{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:20px;align-items:start}
.sgh-col{min-width:0;display:flex;flex-direction:column;gap:20px}
.sgh-card{overflow:hidden;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:var(--sg-shadow-card)}
.sgh-card-h{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--border)}
.sgh-card-h b{flex:1;min-width:0;font-size:15px;font-weight:600;letter-spacing:-.01em;color:var(--text-heading)}
.sgh-ico{flex:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:9px}
.sgh-ico.is-warn{background:var(--sg-warn-soft);color:var(--sg-warn-ink)}
.sgh-ico.is-ok{background:var(--sg-ok-soft);color:var(--sg-ok-ink)}
.sgh-ico.is-accent{background:var(--sg-accent-soft);color:var(--sg-accent-ink)}
.sgh-count{padding:4px 10px;border-radius:999px;background:var(--surface-2);color:var(--text-hint);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}
.sgh-rows{max-height:560px;overflow-y:auto}

.sgh-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto auto;align-items:center;gap:14px;width:100%;padding:14px 18px;border:0;border-top:1px solid var(--border);
  background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background .15s ease}
.sgh-row:first-child{border-top:0}
.sgh-row:hover{background:var(--surface-2)}
.sgh-tile{width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:11px;color:#fff;
  background:linear-gradient(135deg,var(--brand) 0%,#f59e0b 100%)}
.sgh-tile.is-ok{background:var(--sg-ok-soft);color:var(--sg-ok-ink)}
.sgh-tile.is-off{background:var(--surface-3);color:var(--sg-faint)}
.sgh-row-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.sgh-row-main b{font-size:14.5px;font-weight:600;letter-spacing:-.005em;color:var(--text-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sgh-row-main small{display:flex;align-items:center;gap:6px;min-width:0;font-size:12.5px;color:var(--text-hint);white-space:nowrap;overflow:hidden}
.sgh-row-main small span{flex:none}
.sgh-row-main small span:first-child{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.sgh-row-main small i{flex:none;width:3px;height:3px;border-radius:50%;background:var(--sg-faint)}
.sgh-who{display:flex;align-items:center;gap:9px;font-size:12px;color:var(--text-hint);white-space:nowrap}
.sgh-avs{display:inline-flex;padding-left:6px}
.sgh-av{width:28px;height:28px;margin-left:-6px;display:flex;align-items:center;justify-content:center;border-radius:50%;border:2px solid var(--surface);
  background:var(--surface-3);color:var(--text-hint);font-size:10px;font-weight:700;font-style:normal;letter-spacing:.02em}
.sgh-row:hover .sgh-av{border-color:var(--surface-2)}
.sgh-av.is-signed{background:var(--sg-ok);color:#fff}
.sgh-pill{display:inline-flex;align-items:center;height:34px;padding:0 15px;border-radius:9px;background:var(--sg-accent-soft);color:var(--sg-accent-ink);font-size:13px;font-weight:600;transition:background .15s,color .15s}
.sgh-row:hover .sgh-pill{background:var(--brand);color:#fff}
.sgh-badge{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:999px;font-size:11.5px;font-weight:600;white-space:nowrap}
.sgh-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.sgh-badge.is-done{background:var(--sg-ok-soft);color:var(--sg-ok-ink)}
.sgh-badge.is-wait{background:var(--sg-warn-soft);color:var(--sg-warn-ink)}
.sgh-badge.is-off{background:var(--surface-3);color:var(--text-hint)}
.sgh-row.is-compact{grid-template-columns:34px minmax(0,1fr) auto;gap:12px;padding:12px 18px}
.sgh-row.is-compact .sgh-tile{width:34px;height:34px;border-radius:10px}
.sgh-rowwrap{display:flex;align-items:center;border-top:1px solid var(--border)}
.sgh-rowwrap:first-child{border-top:0}
.sgh-rowwrap .sgh-row{border-top:0;flex:1;min-width:0}
.sgh-remind{flex:none;height:34px;margin-right:18px;padding:0 14px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text-body);font:600 13px/1 var(--sg-font);cursor:pointer}
.sgh-remind:hover:not(:disabled){border-color:color-mix(in srgb,var(--brand) 50%,transparent);background:var(--sg-accent-soft);color:var(--sg-accent-ink)}
.sgh-empty{display:flex;flex-direction:column;align-items:center;gap:4px;padding:34px 22px;text-align:center}
.sgh-empty .sgh-empty-ico{width:52px;height:52px;margin-bottom:8px;display:flex;align-items:center;justify-content:center;border-radius:14px;background:var(--surface-2);color:var(--text-hint)}
.sgh-empty b{font-size:15px;font-weight:600;color:var(--text-heading)}
.sgh-empty span{font-size:13px;color:var(--text-hint);max-width:34ch}

/* your signature */
.sgh-sig{display:flex;flex-direction:column;gap:12px;padding:16px 18px 18px}
.sgh-paper{height:96px;display:flex;align-items:center;justify-content:center;padding:10px 16px;border:1px solid var(--border);border-radius:12px;background:#fff} /* paper-white in both themes: the ink is navy, as on the certificate */
.sgh-paper img{max-height:100%;max-width:100%;object-fit:contain}
.sgh-paper.is-empty{border-style:dashed;background:var(--surface-2);color:var(--sg-faint)}
.sgh-sig-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.sgh-lock{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:999px;background:var(--sg-ok-soft);color:var(--sg-ok-ink);font-size:11.5px;font-weight:600}
.sgh-fp{font-family:var(--mono);font-size:11px;color:var(--sg-faint)}
.sgh-sig p{margin:0;font-size:13px;line-height:1.5;color:var(--text-hint)}
.sgh-link{align-self:flex-start;padding:0;border:0;background:none;color:var(--sg-accent-ink);font:600 13px/1.3 var(--sg-font);cursor:pointer}
.sgh-link:hover{text-decoration:underline}
.sgh-sk{display:block;border-radius:8px;background:var(--surface-3);animation:sg-pulse 1.4s ease-in-out infinite}
@keyframes sg-pulse{50%{opacity:.5}}

@media (max-width:900px){
  .sgh-cols{grid-template-columns:1fr}
}
@media (max-width:640px){
  body.signer-home[data-page="signatures"] #topbar{padding-left:14px;padding-right:12px}
  body.signer-home[data-page="signatures"] #routeView{padding-left:14px;padding-right:14px}
  .sgh{padding:20px 0 64px;gap:16px}
  .sgh-welcome h1{font-size:23px}
  .sgh-hero{grid-template-columns:auto minmax(0,1fr);padding:18px;gap:14px}
  .sgh-hero-text b{font-size:16.5px}
  .sgh-hero .sg-cta{grid-column:1 / -1;width:100%;height:52px}
  .sgh-row{grid-template-columns:40px minmax(0,1fr) auto;gap:12px;padding:14px 16px;row-gap:10px}
  .sgh-row .sgh-who{grid-column:2 / -1;grid-row:2}
  .sgh-row .sgh-pill{grid-column:3;grid-row:1}
  .sgh-row.is-compact{grid-template-columns:34px minmax(0,1fr)}
  .sgh-row.is-compact .sgh-badge{grid-column:2;justify-self:start}
  .sgh-card-h{padding:13px 16px}
  .sgh-rows{max-height:none}
  .sgh-rowwrap{flex-wrap:wrap}
  .sgh-remind{margin:0 16px 12px 68px}
}

/* ── the document viewer: the certificate as it prints, the signer's panel beside it (below it on a phone) ── */
.sgv{position:fixed;top:0;right:0;bottom:0;left:var(--nav-gap);z-index:3600;display:none;flex-direction:column;background:var(--bg);
  font-family:var(--sg-font);color:var(--text-body);-webkit-font-smoothing:antialiased}
.sgv.open{display:flex;animation:sgv-in .22s ease}
@keyframes sgv-in{from{opacity:0}to{opacity:1}}
body.sgv-lock{overflow:hidden}
.sgv-top{flex:none;display:flex;align-items:center;gap:12px;height:56px;padding:0 16px;background:var(--surface);border-bottom:1px solid var(--border)}
.sgv-back{display:inline-flex;align-items:center;gap:4px;height:38px;padding:0 14px 0 8px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text-body);font:600 14px/1 var(--sg-font);cursor:pointer;transition:background .15s}
.sgv-back:hover,.sgv-nav:hover{background:var(--surface-2)}
.sgv-title{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.sgv-title b{font-size:15px;font-weight:600;letter-spacing:-.01em;color:var(--text-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sgv-title small{font-size:12px;color:var(--text-hint)}
.sgv-title small:empty{display:none}
.sgv-pager{display:flex;gap:6px}
.sgv-pager[hidden]{display:none}
.sgv-nav{width:38px;height:38px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text-body);cursor:pointer;transition:background .15s}
.sgv-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 384px}
.sgv-docwrap{position:relative;min-width:0;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:12px}
.sgv-stage{flex:none;transform-origin:center center;border-radius:2px;box-shadow:0 1px 2px rgba(0,0,0,.08),0 24px 60px -24px rgba(15,23,42,.45)}
.sgv-side{min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:14px;background:var(--surface);border-left:1px solid var(--border)}
.sgv-card{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface)}
.sgv-card-h{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sgv-card-h > b{font-size:15px;font-weight:600;letter-spacing:-.01em;color:var(--text-heading)}
.sgv-who{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.sgv-who li{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:11px;padding:10px 0;border-top:1px solid var(--border)}
.sgv-who li:first-child{border-top:0;padding-top:2px}
.sgv-who .sgh-av{width:34px;height:34px;margin:0;border:0;font-size:11.5px}
.sgv-who-main{min-width:0;display:flex;flex-direction:column;gap:1px}
.sgv-who-main b{font-size:14px;font-weight:600;color:var(--text-heading);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sgv-who-main > span{font-size:12.5px;color:var(--text-hint)}
.sgv-who-main small{display:inline-flex;align-items:center;gap:4px;margin-top:2px;font-family:var(--mono);font-size:10.5px;color:var(--sg-ok-ink)}
.sgv-when{font-size:12px;color:var(--text-hint);white-space:nowrap;text-align:right}
.sgv-who li.is-signed .sgv-when{color:var(--sg-ok-ink);font-weight:600}
.sgv-facts{margin:0;padding-top:12px;border-top:1px solid var(--border);display:grid;gap:7px;font-size:13px}
.sgv-facts div{display:grid;grid-template-columns:68px minmax(0,1fr);gap:8px}
.sgv-facts dt{color:var(--text-hint)}
.sgv-facts dd{margin:0;color:var(--text-body)}
.sgv-sign{border-color:color-mix(in srgb,var(--brand) 26%,transparent);box-shadow:0 10px 30px -18px color-mix(in srgb,var(--brand) 60%,transparent)}
.sgv-seg{display:inline-flex;padding:3px;border-radius:9px;background:var(--surface-2)}
.sgv-seg button{height:28px;padding:0 11px;border:0;border-radius:7px;background:none;color:var(--text-hint);font:500 12.5px/1 var(--sg-font);cursor:pointer}
.sgv-seg button.on{background:var(--surface);color:var(--text-heading);font-weight:600;box-shadow:var(--sg-shadow-card)}
.sgv-saved{height:104px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:12px;background:#fff}
.sgv-saved img{max-height:80%;max-width:90%}
.sgv-pad{position:relative;border:1.5px dashed color-mix(in srgb,var(--brand) 45%,var(--border));border-radius:12px;background:#fff;overflow:hidden} /* paper-white in both themes: ink on the certificate */
.sgv-pad canvas{display:block;width:100%;aspect-ratio:5/2;touch-action:none;cursor:crosshair}
.sgv-padline{position:absolute;left:8%;right:8%;bottom:24%;border-bottom:1px solid var(--gray-5);pointer-events:none}
.sgv-padhint{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;font-size:13px;color:#9ca3af;pointer-events:none;transition:opacity .15s}
.sgv-pad.has-ink .sgv-padhint{opacity:0}
.sgv-padacts{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sgv-hint{display:inline-flex;align-items:center;gap:6px;margin:0;font-size:12px;color:var(--text-hint)}
.sgv-hint svg{flex:none}
.sgv-check{display:inline-flex;align-items:center;gap:9px;font-size:13.5px;font-weight:500;color:var(--text-body);cursor:pointer}
.sgv-check input{width:19px;height:19px;accent-color:var(--brand);cursor:pointer}
.sgv-go{width:100%;height:52px;font-size:15.5px}
.sgv-fine{margin:0;font-size:12px;line-height:1.5;color:var(--text-hint);text-align:center}
.sgv-err{margin:0;color:var(--bad);font-size:13px;font-weight:600}
.sgv-err:empty{display:none}
.sgv-ro{display:flex;align-items:center;gap:8px;margin:0;padding:12px 14px;border-radius:12px;background:var(--surface-2);font-size:13px;color:var(--text-hint)}
.sgv-done{align-items:center;text-align:center;border-color:color-mix(in srgb,var(--sg-ok) 40%,transparent);background:var(--sg-ok-soft)}
.sgv-done-ico{width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--sg-ok);color:#fff;animation:sgv-pop .45s cubic-bezier(.22,1.4,.36,1)}
@keyframes sgv-pop{from{transform:scale(.4);opacity:0}to{transform:none;opacity:1}}
.sgv-done > b{font-size:17px;font-weight:600;color:var(--text-heading)}
.sgv-done > span{font-size:13.5px;color:var(--text-body)}
.sgv-done-acts{display:flex;flex-direction:column;gap:8px;width:100%;margin-top:4px}
.sgv-ghost{height:44px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text-body);font:600 14px/1 var(--sg-font);cursor:pointer}
.sgv-ghost:hover{background:var(--surface-2)}
.sgv-skel{display:flex;flex-direction:column;gap:10px}
/* the signer's line(s) on the certificate */
.cert-stage .sgv-mark{position:absolute;top:618px;width:300px;height:88px;border:2px dashed var(--brand);border-radius:10px;background:color-mix(in srgb,var(--brand) 6%,transparent);pointer-events:none}
.cert-stage .sgv-mark.has-sig{background:transparent;border-color:color-mix(in srgb,var(--brand) 55%,transparent)}
.cert-stage .sgv-mark span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--brand);font:600 16px/1 "Inter",system-ui,sans-serif}
.cert-stage .sgv-mark.has-sig span{display:none}
@media (prefers-reduced-motion:reduce){.sgv.open,.sgv-done-ico,.sgh-sk{animation:none}}
@media (max-width:900px){
  .sgv{left:0}
  .sgv-body{display:flex;flex-direction:column;overflow-y:auto}
  .sgv-docwrap{flex:none;height:var(--sgv-h,260px);padding:10px;box-sizing:content-box}
  .sgv-side{overflow:visible;border-left:0;border-top:1px solid var(--border);padding:14px 14px 28px}
  .sgv-top{padding:0 12px}
}

/* ── the phone's full-screen landscape signing pad (signatures.js openFullPad) ───────────────────────────────────
   A dark bar over a white sheet: the pad is paper in both themes, as the certificate is. Held upright, .is-rot turns
   the whole frame 90° clockwise to fill the screen sideways (the script maps the finger back: pad(..., rotated)). */
.sgf{position:fixed;inset:0;z-index:3800;display:none;background:#fff;font-family:"Inter",system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;
  touch-action:none;overscroll-behavior:contain}
.sgf.open{display:block}
body.sgf-lock{overflow:hidden}
.sgf-frame{position:absolute;inset:0;display:flex;flex-direction:column}
.sgf.is-rot .sgf-frame{inset:auto;top:0;left:100vw;left:100dvw;width:100vh;width:100dvh;height:100vw;height:100dvw;transform-origin:top left;transform:rotate(90deg)}
.sgf-bar{flex:none;display:flex;align-items:center;gap:8px;height:48px;padding:0 10px;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));background:#141416;color:#fff}
.sgf-title{flex:1;min-width:0;text-align:center;font-size:14px;font-weight:600;letter-spacing:-.005em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sgf-btn{flex:none;height:34px;padding:0 13px;border:0;border-radius:8px;background:rgba(255,255,255,.1);color:#fff;font-family:inherit;font-size:13px;font-weight:600;line-height:1;cursor:pointer}
.sgf-btn.is-done{background:var(--brand);padding:0 16px}
.sgf-btn:disabled{opacity:.4;cursor:not-allowed}
.sgf-pad{position:relative;flex:1;min-height:0;margin:10px;margin-bottom:max(10px,env(safe-area-inset-bottom));border:1.5px dashed var(--gray-5);border-radius:14px;background:#fff;overflow:hidden}
.sgf-pad canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:crosshair}
.sgf-line{position:absolute;left:7%;right:7%;top:68%;border-bottom:1.5px solid var(--gray-5);pointer-events:none}
.sgf-x{position:absolute;left:calc(7% - 2px);top:calc(68% - 24px);color:#9aa1ad;pointer-events:none}
.sgf-hint{position:absolute;left:0;right:0;top:38%;text-align:center;font-size:15px;color:#a3a8b2;pointer-events:none;transition:opacity .15s}
.sgf-pad.has-ink .sgf-hint{opacity:0}
/* held upright, the pad is drawn sideways: this note (inside the turned pad, so it reads once the phone is turned) */
.sgf-turn{display:none}
.sgf.is-rot .sgf-turn{display:inline-flex;position:absolute;top:12px;left:50%;transform:translateX(-50%);align-items:center;gap:6px;padding:5px 11px;border-radius:999px;
  background:#141416;color:#fff;font-size:12px;font-weight:600;white-space:nowrap;pointer-events:none;animation:sgf-nudge 1.6s ease-in-out 3}
.sgf.is-rot .sgf-pad.has-ink .sgf-turn{display:none}
@keyframes sgf-nudge{50%{opacity:.45}}
@media (prefers-reduced-motion:reduce){.sgf.is-rot .sgf-turn{animation:none}}

/* the phone's "Tap to sign" tile in the viewer (opens the pad above; shows the signature once drawn) */
.sgv-tap{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;height:96px;padding:8px 12px;border:1.5px dashed color-mix(in srgb,var(--brand) 45%,var(--border));border-radius:12px;background:#fff;color:#4b5563;font-family:inherit;cursor:pointer}
.sgv-tap-ico{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:color-mix(in srgb,var(--brand) 12%,#fff);color:var(--brand)}
.sgv-tap b{font-size:14px;font-weight:600;color:#1a1a1f}
.sgv-tap small{font-size:11.5px;color:#9ca3af}
.sgv-tap.has-ink{border-style:solid;border-color:var(--gray-4)}
.sgv-tap img{max-height:58px;max-width:90%;object-fit:contain}

/* ── phones: everything a size or two smaller — the signers use small phones too ─────────────────────────────── */
@media (max-width:640px){
  body[data-page="signatures"].has-header #topbar{height:50px;gap:8px}
  body[data-page="signatures"] #routeView{min-height:calc(100vh - 50px)}
  .sgb-brand{gap:8px;font-size:14px}
  .sgb-logo{width:26px;height:26px;border-radius:8px}
  .sgb-logo svg{width:12px;height:12px}
  .sgb-live{height:24px;padding:0 8px}
  .sgb-user{height:34px}
  .sgb-av{width:28px;height:28px;font-size:10.5px}
  .sgb-menu{min-width:210px}
  .sgb-menu-h b,.sgb-menu button{font-size:13px}
  .sgb-menu button{height:36px}

  .sgh{padding:14px 0 48px;gap:12px}
  .sgh-welcome h1{font-size:19px;letter-spacing:-.02em}
  .sgh-welcome p{margin-top:2px;font-size:12px}
  .sgh-seg button{height:28px;padding:0 10px;font-size:12px}
  .sgh-note{margin-top:-2px;padding:8px 11px;font-size:12px;border-radius:8px}
  .sgh-hero{grid-template-columns:auto minmax(0,1fr);gap:10px 11px;padding:12px;border-radius:12px}
  .sgh-hero-ico{width:34px;height:34px;border-radius:10px}
  .sgh-hero-ico svg{width:16px;height:16px}
  .sgh-hero-text{gap:1px}
  .sgh-hero-text b{font-size:14px;line-height:1.3}
  .sgh-hero-text span{font-size:12px;line-height:1.35}
  .sg-cta{height:40px;padding:0 16px;gap:7px;border-radius:9px;font-size:13.5px}
  .sg-cta svg{width:15px;height:15px}
  .sgh-hero .sg-cta{height:42px}
  .sgh-cols,.sgh-col{gap:12px}
  .sgh-card{border-radius:12px}
  .sgh-card-h{gap:8px;padding:9px 12px}
  .sgh-card-h b{font-size:13px}
  .sgh-ico{width:26px;height:26px;border-radius:7px}
  .sgh-ico svg{width:14px;height:14px}
  .sgh-count{padding:2px 8px;font-size:11px}
  .sgh-row{grid-template-columns:32px minmax(0,1fr) auto;gap:10px;row-gap:6px;padding:10px 12px}
  .sgh-tile{width:32px;height:32px;border-radius:9px}
  .sgh-tile svg{width:15px;height:15px}
  .sgh-row-main b{font-size:13px}
  .sgh-row-main small{font-size:11px;gap:5px}
  .sgh-who{gap:6px;font-size:10.5px}
  .sgh-av{width:22px;height:22px;margin-left:-5px;font-size:8.5px;border-width:1.5px}
  .sgh-avs{padding-left:5px}
  .sgh-av svg{width:10px;height:10px}
  .sgh-pill{height:28px;padding:0 10px;border-radius:7px;font-size:11.5px}
  .sgh-badge{height:20px;padding:0 8px;font-size:10px;gap:5px}
  .sgh-badge::before{width:5px;height:5px}
  .sgh-row.is-compact{grid-template-columns:28px minmax(0,1fr) auto;padding:9px 12px}
  .sgh-row.is-compact .sgh-tile{width:28px;height:28px;border-radius:8px}
  .sgh-row.is-compact .sgh-tile svg{width:13px;height:13px}
  .sgh-row.is-compact .sgh-badge{grid-column:3;justify-self:end}
  .sgh-remind{height:28px;margin:0 12px 10px 54px;padding:0 10px;font-size:11.5px;border-radius:7px}
  .sgh-sig{gap:9px;padding:12px}
  .sgh-paper{height:72px;border-radius:10px;padding:8px 12px}
  .sgh-lock{height:20px;padding:0 8px;font-size:10px}
  .sgh-fp{font-size:9.5px}
  .sgh-sig p,.sgh-link{font-size:11.5px}
  .sgh-empty{padding:22px 16px}
  .sgh-empty .sgh-empty-ico{width:40px;height:40px;border-radius:11px;margin-bottom:4px}
  .sgh-empty b{font-size:13px}
  .sgh-empty span{font-size:11.5px}

  .sgv-top{height:48px;gap:8px;padding:0 10px}
  .sgv-back{height:32px;padding:0 10px 0 5px;font-size:12.5px;border-radius:8px}
  .sgv-back svg,.sgv-nav svg{width:15px;height:15px}
  .sgv-nav{width:32px;height:32px;border-radius:8px}
  .sgv-title b{font-size:13px}
  .sgv-title small{font-size:10.5px}
  .sgv-side{gap:10px;padding:10px 10px 22px}
  .sgv-card{gap:9px;padding:12px;border-radius:12px}
  .sgv-card-h > b{font-size:13px}
  .sgv-seg button{height:24px;padding:0 9px;font-size:11px}
  .sgv-saved{height:76px;border-radius:10px}
  .sgv-tap{height:78px;border-radius:10px}
  .sgv-check{gap:7px;font-size:12px}
  .sgv-check input{width:16px;height:16px}
  .sgv-go{height:42px;font-size:13.5px}
  .sgv-fine{font-size:10.5px}
  .sgv-err{font-size:12px}
  .sgv-ro{padding:9px 11px;font-size:12px;border-radius:10px}
  .sgv-who li{grid-template-columns:28px minmax(0,1fr) auto;gap:9px;padding:8px 0}
  .sgv-who .sgh-av{width:28px;height:28px;font-size:9.5px}
  .sgv-who-main b{font-size:12.5px}
  .sgv-who-main > span{font-size:11px}
  .sgv-who-main small{font-size:9.5px}
  .sgv-when{font-size:10.5px}
  .sgv-facts{gap:5px;padding-top:9px;font-size:11.5px}
  .sgv-facts div{grid-template-columns:56px minmax(0,1fr)}
  .sgv-done-ico{width:42px;height:42px}
  .sgv-done > b{font-size:15px}
  .sgv-done > span{font-size:12px}
  .sgv-ghost{height:38px;font-size:12.5px;border-radius:9px}
  .sgh-badge.is-wait{font-size:10px}
}
/* the smallest phones (≈ 360 px and under): one more notch, and drop what isn't needed */
@media (max-width:380px){
  body.signer-home[data-page="signatures"] #topbar{padding-left:10px;padding-right:8px}
  body.signer-home[data-page="signatures"] #routeView{padding-left:10px;padding-right:10px}
  .sgb-brand span:last-child{font-size:13px}
  .sgb-live{display:none}
  .sgh-welcome h1{font-size:17px}
  .sgh-hero-text b{font-size:13px}
  .sgh-hero-text span{display:none}
  .sg-cta,.sgh-hero .sg-cta,.sgv-go{height:38px;font-size:13px}
  .sgh-row-main b{font-size:12.5px}
  .sgh-who > span:last-child{display:none}
  .sgv-title small{display:none}
}

/* the home's To sign / History toggle (signatures.js render): the count rides on "To sign" */
.sgh-seg button{display:inline-flex;align-items:center;gap:6px}
.sgh-seg-n{min-width:18px;height:18px;padding:0 5px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--brand);color:#fff;font-size:10.5px;font-weight:700;font-variant-numeric:tabular-nums}
.sgh-histbtn{flex:none;height:40px;padding:0 16px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text-heading);font:600 13.5px/1 var(--sg-font);cursor:pointer;transition:background .15s,border-color .15s}
.sgh-histbtn:hover{background:var(--surface-2);border-color:color-mix(in srgb,var(--brand) 40%,transparent)}
@media (max-width:640px){
  .sgh-welcome{align-items:stretch;flex-direction:column;gap:10px}
  .sgh-seg{display:flex;width:100%}
  .sgh-seg button{flex:1;justify-content:center;height:30px;font-size:12px}
  .sgh-seg-n{min-width:16px;height:16px;font-size:9.5px}
  .sgh-hero .sgh-histbtn{grid-column:1 / -1;width:100%;height:36px;font-size:12.5px}
}

/* ── Trade Tax register: the certificate workflow (trade.js renderStrip / certCell / printSelected) ──────────── */
.tl-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 12px}
.tl-tile{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);
  color:var(--text-body);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}
.tl-tile:hover{border-color:color-mix(in srgb,var(--text-heading) 22%,var(--border))}
.tl-tile:focus-visible{outline:2px solid var(--brand-bright);outline-offset:2px}
.tl-tile-l{display:inline-flex;align-items:center;gap:7px;font-size:.78rem;font-weight:600;color:var(--text-hint)}
.tl-tile-l i{width:8px;height:8px;border-radius:50%;background:var(--text-hint)}
.tl-tile b{font-size:1.55rem;font-weight:800;line-height:1.15;color:var(--text-heading);font-variant-numeric:tabular-nums}
.tl-tile small{font-size:var(--fs-small);color:var(--text-hint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.tl-tile.is-wait .tl-tile-l i{background:var(--warn)}
.tl-tile.is-done .tl-tile-l i{background:var(--ok)}
.tl-tile.is-bad .tl-tile-l i{background:var(--bad)}
/* Residents: the same tiles (residents.js renderStrip) — no count line under them (the tiles say it) */
.rt-billst .rt-bal.rt-bal-solo{margin-left:0} /* owing / overdue rows: the amount stands alone (orange / red), no tag before it */
.tl-tile.on{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 6%,var(--surface));box-shadow:0 0 0 1px var(--brand) inset}
.tl-tile.on .tl-tile-l{color:var(--text-heading)}
.tl-tile-sk{height:84px;cursor:default;background:var(--surface-2);animation:sg-pulse 1.4s ease-in-out infinite}
.tl-note{grid-column:1 / -1;margin:0;padding:9px 12px;border-radius:8px;background:color-mix(in srgb,var(--ok) 11%,transparent);color:var(--text-body);font-size:var(--fs-hint)}
.tl-note.bad{background:color-mix(in srgb,var(--bad) 10%,transparent);color:var(--bad);font-weight:600}
/* the Certificate pill */
.tl-cert{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:999px;font-size:.74rem;font-weight:700;white-space:nowrap}
.tl-cert.is-none{background:var(--surface-3);color:var(--text-hint)}
.tl-cert.is-wait{background:color-mix(in srgb,var(--warn) 15%,transparent);color:var(--warn)}
.tl-cert.is-done{background:color-mix(in srgb,var(--ok) 14%,transparent);color:var(--ok)}
.tl-cert.is-off{background:none;color:var(--text-hint);padding:0}
.tl-cert-dots{display:inline-flex;gap:3px}
.tl-cert-dots i{width:7px;height:7px;border-radius:50%;border:1.5px solid currentColor;opacity:.75}
.tl-cert-dots i.on{background:var(--ok);border-color:var(--ok);opacity:1}
/* the selection bar sits above the table and stays in reach while the list scrolls */
.tl-selbar{position:sticky;top:72px;z-index:20;box-shadow:var(--shadow-sm)}
.tl-selbar[hidden]{display:none}
.tl-selbar .btn{display:inline-flex;align-items:center;gap:6px}
@media (max-width:760px){
  .tl-strip{gap:8px}
  .tl-tile{padding:10px 11px}
  .tl-tile b{font-size:1.25rem}
  .tl-tile small{display:none}
  .tl-tile-l{font-size:.7rem}
  .tl-selbar{top:62px}
}
@media (max-width:640px){
  table.rt td[data-label="Certificate"]{grid-area:3/2;justify-self:end}
  /* a selected card is tinted whole (the cells are a grid here — tinting each one left gaps) */
  body[data-page="trade-tax"] table.rt tbody tr.sel{background:rgba(234,108,10,.08)}
  body[data-page="trade-tax"] table.rt tbody tr.sel>td{background:transparent}
  .tl-tile-l{gap:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
}
/* printing several signed certificates (Print N certificates): one letter-landscape page each — a NAMED page, so
   the invoice prints in this same shell keep their own portrait page and margins */
#certPrintHost{display:none}
@page cert{size:letter landscape;margin:0}
@media print{
  body.cert-printing{background:#fff}
  body.cert-printing > :not(#certPrintHost){display:none !important}
  body.cert-printing #certPrintHost{display:block}
  #certPrintHost .cert-print-page{page:cert;position:relative;width:11in;height:8.5in;margin:0;transform:none;box-shadow:none;break-after:page;
    -webkit-print-color-adjust:exact;print-color-adjust:exact}
  #certPrintHost .cert-print-page:last-child{break-after:auto}
}

/* the profile's edit form (profile-detail.js editInner): the EHub # and client # show, locked — they identify the account */
.pf-fixed-v{display:flex;align-items:center;justify-content:space-between;gap:8px;height:42px;padding:0 12px;border:1px dashed var(--border);border-radius:var(--radius-sm);
  background:var(--surface-2);color:var(--text-body);font-family:var(--mono);font-size:.9rem;font-weight:500}
.pf-fixed-t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pf-fixed-lock{flex:none;display:inline-flex;color:var(--text-hint)}
.pf-wide{grid-column:1 / -1}
@media (max-width:560px){ .ov-grid .pf-wide{grid-column:auto} }

/* ── Receipt printer (thermal-printer.js EHubPrinter) + the customer's receipt (receipt.js EHubReceipt), 2026-11-10 ── */
.po-printer-link{display:block;margin:6px auto 0;padding:4px 6px;border:0;background:none;color:var(--text-hint);font:inherit;font-size:var(--fs-hint);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.po-printer-link:hover{color:var(--text-body)}
.tp-sheet{max-width:520px}
.tp-sub{margin:3px 0 0;font-size:var(--fs-hint);color:var(--text-hint)}
.tp-status{display:flex;align-items:center;gap:9px;margin:0 0 14px;font-weight:600;color:var(--text-heading)}
.tp-dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--gray-5)}
.tp-dot.is-ready{background:var(--ok)}
.tp-dot.is-paired{background:var(--warn)}
.tp-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px}
.tp-paper{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-hint);font-weight:600;color:var(--text-subheading)}
.tp-paper .input{height:36px;width:auto;padding:0 8px}
.tp-forget{color:var(--bad)}
/* the browser's print of a receipt (no thermal printer paired): a roll-width slip, nothing else on the page */
#rcPrintHost{display:none}
.rc-paper{width:72mm;margin:0 auto;font:12px/1.35 var(--mono);color:#000}
.rc-org{text-align:center;font-weight:800;font-size:14px;text-transform:uppercase}
.rc-sub{text-align:center;margin-top:2px}
.rc-title{text-align:center;font-weight:800;font-size:20px;letter-spacing:.06em;margin:10px 0 6px}
.rc-rule{border-top:1px dashed #000;margin:6px 0}
.rc-kv{display:flex;justify-content:space-between;gap:10px}
.rc-kv b{font-weight:600;text-align:right}
.rc-total{font-weight:800;font-size:14px}
.rc-total b{font-weight:800}
.rc-line{margin:4px 0}
.rc-line-t{font-weight:700}
.rc-line .rc-kv{padding-left:10px}
.rc-note{margin:6px 0 0}
.rc-foot{text-align:center;margin:10px 0 0}
@media print{
  body.rc-printing{background:#fff}
  body.rc-printing > :not(#rcPrintHost){display:none !important}
  body.rc-printing #rcPrintHost{display:block}
}
@page rc{size:80mm auto;margin:4mm}
body.rc-printing #rcPrintHost{page:rc}

/* the menu's Receipt printer entry (nav.js paintPrinter): a dot when one is paired on this device */
.side-printer{position:relative}
.side-printer-dot{width:7px;height:7px;margin-left:auto;border-radius:50%;background:transparent}
.side-printer-dot.is-paired{background:var(--ok-bright)}
body.nav-collapsed .side-printer-dot{position:absolute;top:8px;right:8px;margin:0}
/* Home's printer chip (thermal-printer.js mountChip), beside the search */
.tp-chip{flex:none;display:inline-flex;align-items:center;gap:7px;height:34px;margin-left:10px;padding:0 12px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-body);font:inherit;font-size:.8rem;font-weight:600;white-space:nowrap;cursor:pointer}
.tp-chip[hidden]{display:none}
.tp-chip.is-ready .tp-dot{background:var(--ok)}
.tp-chip.is-off{border-color:color-mix(in srgb,var(--warn) 45%,var(--border));background:color-mix(in srgb,var(--warn) 9%,var(--surface))}
.tp-chip.is-off .tp-dot{background:var(--warn)}
.tp-chip.is-busy .tp-dot{background:var(--gray-5)}
@media (max-width:640px){ .tp-chip span:not(.tp-dot){display:none} .tp-chip{width:34px;padding:0;justify-content:center;margin-left:6px} }
