/* ==========================================================================
   Residential UI refresh (2026-11-10) — shared styles for the data table and
   the summary cards, first used on Off Market. Learned from what reads well
   in PropStream (tall single line rows, banding, column rules, small muted
   labels over larger values, flat cards) but built on Acwise's own tokens
   (navy, Plus Jakarta Sans). Every app page loads it (2026-11-12,
   templates/_shell/kit_css.html); nothing here changes a page that does not
   opt in with these classes.

   Table:   <table class="ui-table"> ... <td class="ui-num">, <span class="ui-clip">
            table.ui-table.ui-table--dense for very wide grids
   Cards:   .ui-cards > .ui-card (.ui-wide) > .ui-card-title, .ui-hero-label,
            .ui-hero, .ui-hero-sub, .ui-pairs > div > .ui-l + .ui-v, .ui-note
   Stack:   <table class="ui-stack"> rows, tr.ui-total, tr.ui-gap
   Kit primitives (scope free, at the end of this file): .ui-btn (+ --primary,
            --ghost, --danger-text, --icon), .ui-input, .ui-select, .ui-field,
            .ui-modal-backdrop > .ui-modal, .ui-chip, .ui-banner, .ui-page,
            .ui-page-head, .ui-page-title; above them, .ui-status (dot + word)
   ========================================================================== */

/* ---- Data table ---------------------------------------------------------- */
table.ui-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.ui-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted);
               text-transform: none; letter-spacing: 0; background: var(--bg-input);
               padding: 0 12px; height: 40px; white-space: nowrap;
               border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
table.ui-table td { font-size: 13px; color: var(--text-secondary); padding: 0 12px; height: 48px;
               vertical-align: middle; white-space: nowrap; border-bottom: none;
               border-right: 1px solid var(--border-color); }
table.ui-table th:last-child, table.ui-table td:last-child { border-right: none; }
table.ui-table tbody tr:nth-child(even) td { background: #F9FAFB; }
table.ui-table tbody tr:hover td { background: var(--bg-hover, #F3F4F6); }
table.ui-table th.ui-num, table.ui-table td.ui-num { text-align: right; }
table.ui-table td.ui-link { color: var(--primary-color); font-weight: 600; }
table.ui-table td.ui-strong { color: var(--text-primary); font-weight: 600; }
table.ui-table .ui-na { color: var(--text-muted); }

/* A cell that may overflow: clipped with an ellipsis; the full text shows in
   a quiet popover on hover (data-full holds it). */
.ui-clip { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.ui-pop { position: fixed; z-index: 60; max-width: 360px; background: var(--bg-card);
          border: 1px solid var(--border-color); border-radius: var(--radius-card, 10px); padding: 10px 12px;
          box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); font-size: 12.5px;
          color: var(--text-primary); line-height: 1.5; white-space: normal; pointer-events: none; }
.ui-pop ul { margin: 0; padding-left: 16px; }

/* ---- Summary cards ------------------------------------------------------- */
.ui-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ui-card { border: 1px solid var(--border-color); border-radius: var(--radius-card, 10px); padding: 14px 16px;
           background: var(--bg-card); min-width: 0; }
.ui-card.ui-wide { grid-column: 1 / -1; }
.ui-card-title { font-size: 15px; font-weight: 700; color: var(--primary-color); margin-bottom: 10px;
                 display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ui-hero-label, .ui-l { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.ui-hero { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.15;
           font-variant-numeric: tabular-nums; }
.ui-hero-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ui-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 12px; }
.ui-pairs.ui-3 { grid-template-columns: 1fr 1fr 1fr; }
.ui-v { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-top: 1px;
        font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ui-v.ui-v-sm { font-size: 13px; }
.ui-note { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.45; }

/* ---- Money stack (ARV down to a price) ------------------------------------ */
.ui-stack { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ui-stack td { padding: 6px 0; font-size: 13.5px; color: var(--text-secondary);
               border-bottom: 1px solid var(--bg-input); }
.ui-stack td:last-child { text-align: right; color: var(--text-primary); font-weight: 600; }
.ui-stack tr.ui-total td { border-bottom: none; border-top: 1px solid var(--border-color);
                           padding-top: 9px; font-size: 15px; color: var(--text-primary); font-weight: 700; }
.ui-stack tr.ui-total td:last-child { font-size: 20px; }
.ui-stack tr.ui-gap td { border-bottom: none; padding-top: 12px; }

/* Quiet text button inside a card title (e.g. "See comps"). */
.ui-link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px;
               font-weight: 600; color: var(--primary-color); cursor: pointer; }
.ui-link-btn:hover { text-decoration: underline; }

/* ---- Tracker grid (the new layout) ----------------------------------------
   The tracker grid keeps its own engine (sticky name column, inline edit,
   drag reorder, autofit widths), so it does not take class ui-table; the
   same visual rules apply inside .tracker-shell, a class index.html sets on
   the tracker container for every org (residential first, CRE multifamily
   on 2026-11-11, every org including generic and any top bar org on
   2026-11-12). Layout and look only: an org's own columns, labels, phases
   and colors are its data and are never restyled here. !important only
   where the base grid uses it (sticky cell backgrounds). */
.tracker-shell .tracker-table th { height: 40px; padding: 0 8px; font-size: 12px; font-weight: 600;
    text-transform: none; letter-spacing: 0; color: var(--text-muted); background: var(--bg-input);
    border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.tracker-shell .tracker-table th:nth-child(1), .tracker-shell .tracker-table th:nth-child(2),
.tracker-shell .tracker-table th.col-sticky, .tracker-shell .tracker-table th.col-sticky-2,
.tracker-shell .tracker-table th.tih-addcol-th,
#tracker-tab.fullscreen .tracker-shell .tracker-table th { background: var(--bg-input) !important; }
.tracker-shell .tracker-table th.sortable:hover,
.tracker-shell .tracker-table th.sortable.col-sticky:hover { background: var(--bg-hover, #F3F4F6) !important; }
/* Hover icons overlay the header edge on this background (no reserved width). */
.tracker-shell .tracker-table th { --tih-bg: var(--bg-input); }
.tracker-shell .tracker-table th.sortable:hover { --tih-bg: var(--bg-hover, #F3F4F6); }
/* Headers wrap to two lines; the row stays 40px, labels vertically centered. */
.tracker-shell .tracker-table th { line-height: 1.15; }
.tracker-shell .tracker-table th.col-doc { padding: 0 2px; font-size: 10px; }
/* The sort arrow exists only on the sorted column (2026-11-13: a header
   click sorts; no hover arrow elsewhere). */
.tracker-shell .tracker-table th .sort-indicator { font-size: 10px; opacity: 1; }
.tracker-shell .tracker-table th:last-child, .tracker-shell .tracker-table td:last-child { border-right: none; }
.tracker-shell .tracker-table td { height: 48px; padding: 0 8px; font-size: 13px; color: var(--text-secondary);
    border-bottom: none; border-right: 1px solid var(--border-color); }
.tracker-shell .tracker-table td:nth-child(1) { padding: 0; }
/* Banded rows (sticky cells included, so the band runs edge to edge). */
.tracker-shell .tracker-table tbody tr:nth-child(even) td,
#tracker-tab.fullscreen .tracker-shell .tracker-table tbody tr:nth-child(even) td { background: #F9FAFB !important; }
.tracker-shell .tracker-table tbody tr:hover td,
#tracker-tab.fullscreen .tracker-shell .tracker-table tbody tr:hover td { background: var(--bg-hover, #F3F4F6) !important; }
/* States the base grid paints keep their look over the band. */
.tracker-shell .tracker-table tbody tr.tr-archived td,
#tracker-tab.fullscreen .tracker-shell .tracker-table tbody tr.tr-archived td { background: #f3f4f6 !important; color: #6b7280 !important; }
.tracker-shell .tracker-table td.nav-focus { background: #f3f6f1 !important; }
/* The one clickable column: the deal name, in the link ink. */
.tracker-shell .tracker-table td.col-property-name a { font-weight: 600 !important; }
.tracker-shell .tracker-table td .editable-cell { padding-left: 0; padding-right: 0; }
.tracker-shell .tracker-table td .editable-cell.ui-clip { max-width: none; }
/* Dropdown pills read at table size. */
.tracker-shell .tracker-table td .badge { font-size: 11.5px; padding: 3px 9px; font-weight: 600; }

/* ---- Tracker geometry (new layout, desktop) ------------------------------
   res_morning.js keeps --tr-grid-top = where the grid row starts on the page.
   The grid hugs its rows but never runs past the window, so its horizontal
   scrollbar sits on screen (it scrolls inside, header sticky); the pipeline
   map beside it is exactly the visible height, so its bottom shows without a
   page scroll. Fullscreen and phones keep their own layouts. */
body:not(.mobile) .tracker-shell .tracker-content-row { align-items: flex-start; }
body:not(.mobile) .tracker-shell .tracker-table-wrapper {
    max-height: calc(100vh - var(--tr-grid-top, 140px) - 16px); }
body:not(.mobile) :is(.tracker-shell, .acm-side) .tracker-map-panel {
    position: relative; top: auto; align-self: flex-start;
    height: calc(100vh - var(--tr-grid-top, 140px) - 16px); max-height: none; min-height: 360px;
    margin-left: 12px; border: 1px solid var(--border-color); border-radius: 10px;
    overflow: hidden; background: var(--bg-card);
    /* Wider than the shared 35% / 500px panel: grows with the screen, while a
       laptop (1366 to 1536 wide) keeps about 60% for the table. */
    width: clamp(360px, 38%, 860px); max-width: 860px; }
@media (min-width: 1680px) {
    body:not(.mobile) :is(.tracker-shell, .acm-side) .tracker-map-panel { width: clamp(360px, 44%, 860px); } }
#tracker-tab.fullscreen .tracker-shell .tracker-table-wrapper { max-height: none; }
#tracker-tab.fullscreen .tracker-shell .tracker-map-panel { height: auto; align-self: stretch;
    margin-left: 0; border-radius: 0; border-width: 0 0 0 1px; }
/* The map's own fullscreen keeps its fixed overlay rules (they use !important). */
.tracker-shell .tracker-map-panel.fullscreen { margin-left: 0; border-radius: 0; }

/* ---- Pipeline map controls (new layout) ---------------------------------
   One header row: title, the pin select and two quiet text actions; the map
   layers as one row of chips under it (Off Market chip look). Markup is the
   shared panel; only the look changes, scoped to .tracker-shell. The Off
   Market map (.acm-side, res_leads.html) wears the same rules: every side
   map built by static/js/acwise_map.js looks the same. */
:is(.tracker-shell, .acm-side) .tracker-map-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 10px 12px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.tracker-shell .tracker-map-controls { display: contents; }
.tracker-shell .tracker-map-title { order: 0; font-size: 13px; font-weight: 700; color: var(--text-primary);
    margin-right: auto; }
.tracker-shell .tracker-map-geocode-status { order: 1; }
.tracker-shell #tracker-map-label-select { order: 2; }
.tracker-shell #tracker-map-fs-btn { order: 3; }
.tracker-shell .tracker-map-ctl-btn:not(.tracker-map-chip):not(#tracker-map-fs-btn) { order: 4; }
.tracker-shell .tracker-map-close-x { order: 5; }
:is(.tracker-shell, .acm-side) .tracker-map-chips { order: 10; flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px; }
:is(.tracker-shell, .acm-side) .tracker-map-ctl { font-family: var(--font-body); line-height: 1; }
.tracker-shell .tracker-map-ctl-select { height: 28px; padding: 0 8px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 14px; max-width: 150px; }
/* Fullscreen / Hide: quiet text actions, not boxed buttons. */
:is(.tracker-shell, .acm-side) .tracker-map-ctl-btn:not(.tracker-map-chip) { height: 28px; padding: 0 4px; border: 0;
    background: none; font-size: 12px; font-weight: 600; color: var(--primary-color); box-shadow: none; }
:is(.tracker-shell, .acm-side) .tracker-map-ctl-btn:not(.tracker-map-chip):hover { text-decoration: underline; background: none; }
:is(.tracker-shell, .acm-side) .tracker-map-chip { height: 26px; padding: 0 10px; border: 1px solid var(--border-color);
    border-radius: 13px; background: var(--bg-card); font-size: 12px; font-weight: 500;
    color: var(--text-secondary); box-shadow: none; }
:is(.tracker-shell, .acm-side) .tracker-map-chip:hover { border-color: var(--primary-color); color: var(--text-primary); }
:is(.tracker-shell, .acm-side) .tracker-map-chip.active { background: var(--bg-input); border-color: var(--primary-color);
    color: var(--primary-color); font-weight: 600; }
.tracker-shell #tracker-map-sat-btn, .acm-side .acm-sat { margin-left: auto; }
.tracker-shell .tracker-map-pins-row { padding: 6px 12px; font-size: 11.5px; }

/* ---- Grid dropdown menu (residential; app.js _trDDOpenFor) ---------------
   The open list of a dropdown cell: every option is the same pill the cell
   shows (the org's saved colors); a value without a color reads as text. */
.tr-ddm { position: fixed; z-index: 400; max-height: 320px; overflow-y: auto; padding: 4px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-card, 10px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); font-family: var(--font-body); outline: none; }
.tr-ddm-item { display: flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 6px;
    font-size: 13px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.tr-ddm-item.is-hi { background: var(--bg-input); }
.tr-ddm-item.is-on { box-shadow: inset 2px 0 0 var(--primary-color); color: var(--text-primary); }
.tr-ddm-item .badge { font-size: 11.5px; padding: 3px 9px; font-weight: 600; }
.tr-ddm-none { color: var(--text-muted); }

/* ---- Tracker toolbar (new layout, desktop) -------------------------------
   One control height (32px) for inputs and buttons, 8px radius, 13px text,
   32x32 icon buttons in the muted icon ink (the Excel mark included), even
   8px gaps. Nothing removed (the toolbar fold waits on the owner). The
   buttons carry inline sizes in the shared markup, hence !important. */
body:not(.mobile) .tracker-shell .tracker-filters .filter-group { gap: 8px !important; }
body:not(.mobile) .tracker-shell .tracker-toolbar { gap: 8px !important; }
body:not(.mobile) .tracker-shell .tracker-filters .btn,
body:not(.mobile) .tracker-shell #tracker-search {
    height: 32px !important; box-sizing: border-box; border-radius: 8px !important;
    font-size: 13px !important; line-height: 1 !important; }
body:not(.mobile) .tracker-shell .tracker-filters .btn { padding: 0 12px !important; gap: 6px; }
body:not(.mobile) .tracker-shell #tracker-search { width: 220px !important; padding: 0 12px !important; }
/* One toolbar row from 1000px up: the search box gives up width (down to
   120px) before the fullscreen button would wrap onto a row of its own
   (it did at 1024 wide). Narrower windows keep wrapping. */
@media (min-width: 1000px) {
    body:not(.mobile) .tracker-shell .tracker-toolbar { flex-wrap: nowrap !important; min-width: 0; }
    body:not(.mobile) .tracker-shell #tracker-search { flex: 0 1 220px; min-width: 120px; }
    body:not(.mobile) .tracker-shell .tracker-toolbar > * { flex-shrink: 0; }
    body:not(.mobile) .tracker-shell .tracker-toolbar > #tracker-search { flex-shrink: 1; }
    body:not(.mobile) .tracker-shell .tracker-toolbar > div[style*="flex:1"] { flex: 1 1 0; min-width: 0; }
}
body:not(.mobile) .tracker-shell .tracker-filters .btn[aria-label],
body:not(.mobile) .tracker-shell #fullscreen-tracker {
    width: 32px; padding: 0 !important; color: var(--text-muted); }
body:not(.mobile) .tracker-shell .tracker-filters .btn[aria-label]:hover,
body:not(.mobile) .tracker-shell #fullscreen-tracker:hover { color: var(--text-primary); }
body:not(.mobile) .tracker-shell .tracker-filters .btn svg { width: 16px !important; height: 16px !important; }
body:not(.mobile) .tracker-shell #open-tracker-excel svg { stroke: currentColor; }
/* The zoom readout box sits with undo / redo at the same height. */
body:not(.mobile) .tracker-shell .tracker-toolbar > div[style*="border:1px solid #e5e7eb"] {
    height: 32px; box-sizing: border-box; border-radius: 8px !important; padding: 0 4px !important;
    border-color: var(--border-color) !important; }
body:not(.mobile) .tracker-shell .tracker-toolbar > div[style*="gap:2px"] { gap: 8px !important; }
body:not(.mobile) .tracker-shell .tracker-toolbar > div[style*="width:1px"] { height: 20px; margin: 0 2px; }

/* ---- Pipeline map, round 3 (new layout) ----------------------------------
   No title, no "N of M mapped" row (the count is the edge tab's hover), no
   browser fullscreen button: the arrow tab on the map's inner edge expands
   the map over the table instead. The phase legend is a strip of pills
   under the map, never over pins. A hover popup has no close x; a pinned
   (clicked) one does. */
.tracker-shell .tracker-map-title,
.tracker-shell .tracker-map-pins-row,
.tracker-shell #tracker-map-fs-btn { display: none !important; }
.tracker-shell #tracker-map-label-select { order: 0; }
:is(.tracker-shell, .acm-side) .tracker-map-panel { position: relative; }
.tracker-map-edge { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 6;
    width: 20px; height: 48px; padding: 0; border: 1px solid var(--border-color); border-left: 0;
    border-radius: 0 8px 8px 0; background: var(--bg-card); color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }
.tracker-map-edge:hover { color: var(--text-primary); }
.tracker-map-edge:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.tracker-map-edge svg { width: 14px; height: 14px; }
.tracker-map-panel.tr-map-over .tracker-map-edge svg { transform: rotate(180deg); }
.tracker-map-panel.fullscreen .tracker-map-edge { display: none; }
/* Over the table: the panel covers the grid inside the tracker row. */
body:not(.mobile) .tracker-shell .tracker-content-row { position: relative; }
body:not(.mobile) :is(.tracker-shell, .acm-side) .tracker-map-panel.tr-map-over {
    position: absolute; left: 0; top: 0; width: auto; right: 0; max-width: none; margin-left: 0; z-index: 160; }
/* The hidden map's reopen bar (2026-11-11): a full height bar on the map's
   side, exactly as tall as the map panel, like a drawer closed against the
   edge; a centered chevron points toward the table. The whole bar is the
   button (AcwiseMap.panel makes it keyboard reachable). The table keeps
   every pixel but the bar's width and its gap. */
:is(.tracker-shell, .acm-side) .tracker-map-tab { width: 22px; box-sizing: border-box; margin: 0 0 0 12px;
    border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card);
    color: var(--text-muted); align-self: flex-start; flex-shrink: 0; cursor: pointer;
    transition: background 120ms ease, color 120ms ease; }
body:not(.mobile) .tracker-shell .tracker-map-tab { height: calc(100vh - var(--tr-grid-top, 140px) - 16px); min-height: 360px; }
body:not(.mobile) .acm-side .tracker-map-tab { height: max(420px, calc(100vh - var(--om-grid-top, 400px) - 16px)); }
:is(.tracker-shell, .acm-side) .tracker-map-tab svg { width: 14px !important; height: 14px !important; }
:is(.tracker-shell, .acm-side) .tracker-map-tab:hover { color: var(--text-primary); background: var(--bg-input); }
:is(.tracker-shell, .acm-side) .tracker-map-tab:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
/* Opening slides the map back in from the bar. */
@keyframes acm-slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
:is(.tracker-shell, .acm-side) .tracker-map-panel.acm-opening { animation: acm-slide-in 220ms cubic-bezier(0.32, 0.72, 0, 1); }
@media (prefers-reduced-motion: reduce) {
    :is(.tracker-shell, .acm-side) .tracker-map-panel.acm-opening { animation: none; } }
/* Phase legend strip */
.tracker-map-phase-legend.tmpl-strip { position: static; display: flex; flex-wrap: wrap; gap: 6px 10px;
    max-width: none; max-height: none; padding: 8px 12px; border: 0; border-top: 1px solid var(--border-color);
    border-radius: 0; box-shadow: none; background: var(--bg-card); }
.tmpl-strip .tmpl-row { gap: 4px; padding: 0; }
.tmpl-strip .tmpl-swatch { display: none; }
.tmpl-strip .tmpl-name.badge { font-size: 11.5px; padding: 3px 9px; font-weight: 600; max-width: none; }
.tmpl-strip .tmpl-count { margin-left: 0; padding-left: 0; font-size: 12px; }
.tracker-map-ov-legend .tmol-zoom { color: var(--text-muted); }
:is(.tracker-shell, .acm-side) .maplibregl-popup.tracker-popup-hover .maplibregl-popup-close-button { display: none; }

/* ---- One key and one popup for every side map (2026-11-11) ---------------
   The legend strip under the map (AcwiseMap.legendStrip): the layer
   legend's strip look, 11px swatch dots drawn in the exact colors the map
   paints, a ring for ring pins, the shared cluster disc, an optional pill
   label (the org's phase colors), a muted count. A clickable row toggles
   its pins; an off row dims. */
.acm-legend { gap: 6px 12px; padding: 8px 12px; background: var(--bg-card); font-size: 12px;
    color: var(--text-secondary); border-top: 1px solid var(--border-color); }
.acm-legend .tmol-title { color: var(--text-primary); margin-right: 2px; }
.acm-legend .tmol-item { gap: 5px; }
.acm-legend .acm-legend-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit;
    cursor: pointer; border-radius: 6px; }
.acm-legend .acm-legend-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.acm-legend .tmol-item.off { opacity: .45; }
.acm-sw { width: 11px; height: 11px; border-radius: 50%; flex: none; box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(15, 23, 42, .18); }
.acm-sw.acm-sw-ring { width: 12px; height: 12px; background: #fff; border: 3px solid var(--primary-color); box-shadow: none; }
.acm-sw.acm-sw-cluster { width: 15px; height: 15px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .18); }
.acm-legend .acm-pill { font-size: 11.5px; padding: 2px 8px; font-weight: 600; }
.acm-legend .acm-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* Popup chrome: the same card on both maps (content differs per map). */
:is(.tracker-shell, .acm-side) .maplibregl-popup-content { font-family: var(--font-body); color: var(--text-primary);
    padding: 12px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }

body.mobile .ui-cards { grid-template-columns: 1fr; }
body.mobile .ui-pairs.ui-3 { grid-template-columns: 1fr 1fr; }

/* ---- Stacked rows on phones (opt in: table.ui-table.ui-stackable) ---------
   Below 640px each row becomes a stanza and each cell a label / value line
   from its data-th attribute (the kit's stacked table pattern, in this
   table's type scale). Tables without .ui-stackable keep their own phone
   behavior. */
@media (max-width: 640px) {
    table.ui-table.ui-stackable thead { display: none; }
    table.ui-table.ui-stackable, table.ui-table.ui-stackable tbody,
    table.ui-table.ui-stackable tr, table.ui-table.ui-stackable td { display: block; width: 100%; box-sizing: border-box; }
    table.ui-table.ui-stackable tr { border-bottom: 1px solid var(--border-color); padding: 8px 12px; }
    table.ui-table.ui-stackable tbody tr:last-child { border-bottom: none; }
    table.ui-table.ui-stackable tbody tr:nth-child(even) td,
    table.ui-table.ui-stackable tbody tr:hover td { background: none; }
    table.ui-table.ui-stackable td { display: flex; justify-content: flex-end; align-items: baseline;
        gap: 12px; height: auto; padding: 3px 0; border-right: none; white-space: normal; text-align: right; }
    table.ui-table.ui-stackable td:empty { display: none; }
    table.ui-table.ui-stackable td::before { content: attr(data-th); font-size: 12px; font-weight: 500;
        color: var(--text-muted); text-align: left; flex: 0 0 auto; margin-right: auto; }
    table.ui-table.ui-stackable td.ui-nolabel::before { content: none; }
}

/* The page tab strip (.page-tabs) styles live in templates/_shell/nav_tabs.html
   (2026-11-11): the strip renders for top bar orgs too, on pages that do
   not load this file. */
/* ---- Acwise loader -------------------------------------------------------
   The animated Acwise mark (static/img/acwise-loader.svg geometry), drawn
   inline by AcwiseLoader in res_ui.js so its stroke is currentColor: it
   takes the theme's primary ink (or any color a container sets). Sizes:
   page (a page or panel first load), card (a card or a large stat block),
   sm (one stat value). Reduced motion swaps the draw for a slow pulse. */
.acw-loader { display: flex; align-items: center; justify-content: center;
              color: var(--primary-color); }
.acw-loader svg { display: block; height: auto; overflow: visible; }
.acw-loader--page { min-height: 240px; padding: 48px 0; }
.acw-loader--page svg { width: 72px; }
.acw-loader--card { min-height: 96px; padding: 20px 0; }
.acw-loader--card svg { width: 40px; }
.acw-loader--sm { display: inline-flex; vertical-align: middle; }
.acw-loader--sm svg { width: 26px; }
.acw-loader .acw-l-track { opacity: .12; }
.acw-loader .acw-l-draw { stroke-dasharray: 1 1; stroke-dashoffset: 1;
    animation: acwise-draw 1.8s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes acwise-draw {
    0%   { stroke-dashoffset: 1; }
    45%  { stroke-dashoffset: 0; }
    60%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1; }
}
@keyframes acwise-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
    .acw-loader .acw-l-draw { animation: acwise-pulse 1.8s ease-in-out infinite; stroke-dashoffset: 0; }
}
/* A table panel while its rows load (2026-11-12, owner): the page loader
   centred over the whole panel, header row included (AcwiseLoader.cover in
   res_ui.js, or a template's <div class="acw-loader-cover"
   data-acw-loader="page" data-acw-until="#rows">). It covers the frozen
   cells and the header too: all of the table or none of it (11/13). */
.acw-load-host, :has(> .acw-loader-cover) { position: relative; }
:has(> .acw-loader-cover) { min-height: 280px; }
.acw-loader-cover { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 160;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card); border-radius: inherit; }
.acw-loader-cover > .acw-loader--page { min-height: 0; padding: 0; }

/* ---- My deals <-> Properties: one shell (2026-11-11) ----------------------
   A same-origin page switch is a cross-document view transition: the
   sidebar, the tab strip and the side map hold their place while the
   content swaps (Chromium; other browsers navigate as before). The map's
   camera and layers carry over through AcwiseMap's shared camera. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
body:not(.mobile) .page-tabs { view-transition-name: acm-page-tabs; }
body:not(.mobile) .tracker-map-panel { view-transition-name: acm-side-map; }
::view-transition-group(*) { animation-duration: 160ms; }

/* The closed map bar reads as a map (2026-11-11): a faint street grid
   texture, a folded map icon and a vertical "Map" label under the chevron.
   CSS only, so both pages' bars (#tracker-map-tab, #om-map-tab) match. */
:is(.tracker-shell, .acm-side) .tracker-map-tab { width: 30px; flex-direction: column; align-items: center;
    justify-content: center; gap: 10px; overflow: hidden;
    background-color: #EEF3F8;
    background-image:
        repeating-linear-gradient(28deg, transparent 0 17px, rgba(30, 58, 95, .07) 17px 18px),
        repeating-linear-gradient(118deg, transparent 0 23px, rgba(30, 58, 95, .07) 23px 24px),
        radial-gradient(circle at 30% 22%, rgba(56, 189, 248, .14) 0 26px, transparent 27px),
        radial-gradient(circle at 70% 68%, rgba(106, 157, 132, .12) 0 34px, transparent 35px);
    color: var(--primary-color); }
:is(.tracker-shell, .acm-side) .tracker-map-tab:hover { background-color: #E3ECF5; color: var(--primary-color); }
:is(.tracker-shell, .acm-side) .tracker-map-tab::before { content: ''; width: 16px; height: 16px; flex: none; order: -1;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4 3 6v14l6-2 6 2 6-2V4l-6 2-6-2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4 3 6v14l6-2 6 2 6-2V4l-6 2-6-2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E") center / contain no-repeat; }
:is(.tracker-shell, .acm-side) .tracker-map-tab::after { content: 'Map'; writing-mode: vertical-rl; flex: none;
    font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

/* The map's Hide stays in the header's top right on both views (2026-11-11:
   on Properties the find box is hidden and Hide slid to the left). */
#tracker-map-panel .tracker-map-controls > .tracker-map-ctl-btn { margin-left: auto; }

/* ---- Side map at laptop sizes (2026-11-13) --------------------------------
   One header row at every desktop width: the pin select, then the layer
   chips (or the one Layers chip they fold into) on the same line, Hide at
   the right; the chips never take a row of their own. The map below gives
   way to the header and the keys (no 300px floor), so a short window keeps
   the whole panel, keys included, on screen. The zoom buttons match the
   26px chips. */
body:not(.mobile) :is(.tracker-shell, .acm-side) .tracker-map-header { flex-wrap: nowrap; }
body:not(.mobile) :is(.tracker-shell, .acm-side) .tracker-map-chips { order: 1; flex: 1 1 auto; min-width: 0;
    flex-wrap: nowrap; }
body:not(.mobile) .tracker-shell #tracker-map-label-select { flex: none; }
body:not(.mobile) .tracker-shell .tracker-map-geocode-status { order: 3; }
body:not(.mobile) :is(.tracker-shell, .acm-side) .tracker-map-header .tracker-map-ctl-btn:not(.tracker-map-chip) { flex: none; }
body:not(.mobile) :is(.tracker-shell, .acm-side) #tracker-map,
body:not(.mobile) .acm-side #sales-map { min-height: 0; }
:is(.tracker-shell, .acm-side) .tracker-map-panel .maplibregl-ctrl-group button { width: 26px; height: 26px; }
:is(.tracker-shell, .acm-side) .tracker-map-panel .maplibregl-ctrl-group { border-radius: 6px; }

/* The table panel is always its full height (2026-11-11): it reaches the
   bottom of the window like the map beside it, whatever the row count, so
   nothing below it moves as rows load and both views read as one shell. */
body:not(.mobile) .tracker-shell .tracker-table-wrapper {
    height: calc(100vh - var(--tr-grid-top, 140px) - 16px); min-height: 360px;
    background: var(--bg-card); border-radius: 10px; }
body:not(.mobile) .rp-table { display: flex; flex-direction: column;
    height: max(420px, calc(100vh - var(--om-grid-top, 400px) - 16px)); }
body:not(.mobile) .rp-table #table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
body:not(.mobile) .rp-table #pagination:empty { display: none; }
/* ---- Tracker view switch (new layout) --------------------------------
   Active | Archive | All (#tracker-view-tabs, every org; base look in
   style.css). Here the quiet segment: 32px, 8px radius, the input tint
   behind, the picked view a white segment in primary ink, so it reads as a
   filter next to the filled My deals | Properties page tabs. Counts muted. */
.tracker-shell .tr-seg { height: 32px; box-sizing: border-box; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--bg-input); padding: 2px; gap: 2px; }
.tracker-shell .tr-seg-btn { height: 26px; box-sizing: border-box; padding: 0 10px; border-radius: 6px;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; line-height: 1;
    background: transparent; color: var(--text-secondary); }
.tracker-shell .tr-seg-btn + .tr-seg-btn { border-left: none; }
.tracker-shell .tr-seg-btn:not(.is-active):hover { color: var(--text-primary); }
.tracker-shell .tr-seg-btn.is-active { background: var(--bg-card); color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--border-color); }
.tracker-shell .tr-seg-btn .tr-count { color: var(--text-muted); font-weight: 500; opacity: 1; }
body.mobile .tracker-shell .tr-seg { height: auto; }
body.mobile .tracker-shell .tr-seg-btn { height: auto; }

/* ---- Placeholder rows while a table loads (2026-11-11) --------------------
   A few faint rows the height of real rows (td height comes from the table's
   own rules: 48px in .ui-table and the tracker grid), so nothing jumps when
   the rows arrive. Rows: AcwiseSkeleton.rows() in res_ui.js, the Jinja macro
   in templates/_shell/skeleton_rows.html, and the tracker grid's own
   .tr-skeleton rows (app.js _showTrackerSkeleton). One bar per cell in a tint
   between the input fill and the rule colour; a slow fade, none when the
   viewer asks for reduced motion. */
tr.acw-skel-row td, .tracker-shell tr.tr-skeleton td,
table.ui-table tbody tr.acw-skel-row:nth-child(even) td,
.tracker-shell .tracker-table tbody tr.tr-skeleton:nth-child(even) td {
    background: var(--bg-card) !important; pointer-events: none; }
.acw-skel-bar, .tracker-shell tr.tr-skeleton .skeleton {
    display: block; height: 10px !important; max-width: 100%; border-radius: 4px !important;
    background: var(--bg-input); background: color-mix(in srgb, var(--bg-input) 55%, var(--border-color));
    animation: acw-skel-fade 1.8s ease-in-out infinite; }
.tracker-shell tr.tr-skeleton .skeleton { margin-top: 0; margin-bottom: 0; }
@keyframes acw-skel-fade { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
    .acw-skel-bar, .tracker-shell tr.tr-skeleton .skeleton { animation: none; } }

/* ---- Header rows hold their height (2026-11-11) ---------------------------
   The one 32px header row of My deals, Properties and Listings: filter chips
   and the buy box chip arrive after the page paints; they sit inside the row
   and never wrap it to a second line or push the tables down. Narrow desktop
   windows (under 1000px) keep their wrapping header. */
@media (min-width: 1000px) {
    body:not(.mobile) .tracker-shell .tracker-filters { height: 32px; flex-wrap: nowrap; }
    body:not(.mobile) .tracker-shell .tracker-filters > .filter-group { flex-wrap: nowrap; min-width: 0; }
    body:not(.mobile) .tracker-shell .tracker-filters :is(.tr-filter-chips, .hunt-chips, .hunt-chips-left) {
        flex-wrap: nowrap; min-width: 0; }
}
/* View counts (Active 4) and tile counts (Tax sale 12) fill in after the
   rows load: an invisible figure space holds a count's room meanwhile
   (data-pending, removed by the script that fills the count). */
.tracker-shell .tr-seg-btn .tr-count[data-pending]:empty { display: inline; }
.tr-count[data-pending]:empty::after { content: '\2007'; }
.acw-tile-count[data-pending]:empty::after { content: '\2007'; }

/* ---- Status dot (2026-11-12, outside the kit primitives on purpose: its
   dot carries fact color, which the primitives never do) ----
   Status: a quiet ~8px colored dot plus the plain word, no tinted fill and
   no pill (2026-11-12). The dot color states a fact (a parse state, a cycle
   phase); scores and ratings never take it. Variants: --ok (green), --warn
   (amber), --err (red), --muted (gray), --outline (hollow), and the four
   cycle phases (tokens in res_kit.css). */
.ui-status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body);
    font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--text-secondary); white-space: nowrap; }
.ui-status::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%;
    box-sizing: border-box; background: var(--ui-status-dot, var(--text-muted)); }
.ui-status--ok { --ui-status-dot: var(--success-color, #16A34A); }
.ui-status--warn { --ui-status-dot: var(--warning-color, #F59E0B); }
.ui-status--err { --ui-status-dot: var(--error-color, #DC2626); }
.ui-status--muted { --ui-status-dot: var(--text-muted, #6B7280); }
.ui-status--outline::before { background: transparent; border: 1px solid var(--text-muted, #6B7280); }
.ui-status--recovery { --ui-status-dot: var(--phase-recovery, #4A78B0); }
.ui-status--expansion { --ui-status-dot: var(--phase-expansion, #3E8A86); }
.ui-status--hyper-supply { --ui-status-dot: var(--phase-hyper-supply, #6B7686); }
.ui-status--recession { --ui-status-dot: var(--phase-recession, #8A5C86); }

/* ---- Kit primitives (theme pass Batch 0, 2026-11-12) ----------------------
   Scope free: any page that loads this file (every app page) composes them.
   Nothing is new: each value is the one the four existing control rules
   already share (the tracker toolbar above, crm.css .crm-btn / .crm-ctl,
   acwise_card.css .acw-card-actions .btn, the Settings shell), the popover
   look of .ui-pop / .acw-ovf-menu, the chip of the tracker pills and the
   page head of crm.css. body.acw-skin (style.css) maps the legacy .btn,
   form controls and .modal onto these same values. */

/* Buttons: one 32px control, 8px radius, 13px text, one filled variant. */
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; box-sizing: border-box; padding: 0 12px; cursor: pointer; white-space: nowrap;
    border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px);
    background: var(--bg-card); color: var(--text-primary); text-decoration: none;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; line-height: 1;
    transition: var(--transition-fast); }
.ui-btn:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); }
.ui-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.ui-btn:disabled { color: var(--text-muted); cursor: default; }
.ui-btn svg { width: 16px; height: 16px; flex: none; }
.ui-btn--primary { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.ui-btn--primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.ui-btn--primary:disabled { opacity: .5; color: #fff; }
.ui-btn--ghost { border-color: transparent; background: none; color: var(--text-secondary); }
.ui-btn--ghost:hover:not(:disabled) { border-color: transparent; background: var(--bg-input); color: var(--text-primary); }
/* Destructive: the error ink, never a red fill. */
.ui-btn--danger-text { color: var(--error-color); }
.ui-btn--danger-text:hover:not(:disabled) { border-color: var(--error-color); color: var(--error-color); }
.ui-btn--icon { width: 32px; padding: 0; color: var(--text-muted); }

/* Inputs and selects. Add .ui-input to a textarea for the multi line box. */
.ui-input, .ui-select { height: 32px; box-sizing: border-box; padding: 0 10px; min-width: 0;
    border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px);
    background-color: var(--bg-card); color: var(--text-primary);
    font-family: var(--font-body); font-size: 13px; line-height: 1; }
textarea.ui-input { height: auto; min-height: 64px; padding: 8px 10px; line-height: 1.45; resize: vertical; }
.ui-select { padding-right: 32px; }
.ui-input::placeholder { color: var(--text-muted); }
.ui-input:focus, .ui-select:focus { outline: none; border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08); }
.ui-input:disabled, .ui-select:disabled { background-color: var(--bg-input); color: var(--text-muted); }

/* A labelled field: 12px muted label over the control. */
.ui-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ui-field > label, .ui-field-label { font-size: 12px; font-weight: 500; color: var(--text-muted);
    text-transform: none; letter-spacing: 0; margin: 0; }
.ui-field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ui-field-row > .ui-field { flex: 1 1 160px; }

/* Modal: a centered card in the popover look over a slate scrim (the
   drawer's scrim, no blur). Markup: .ui-modal-backdrop > .ui-modal >
   .ui-modal-head (.ui-modal-title + close) + body + .ui-modal-foot. */
.ui-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
    justify-content: center; padding: 16px; background: rgba(15, 23, 42, 0.32); }
.ui-modal-backdrop[hidden] { display: none !important; }
.ui-modal { width: 440px; max-width: 100%; max-height: 85vh; overflow-y: auto; box-sizing: border-box;
    padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-card, 10px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    font-family: var(--font-body); font-size: 13px; color: var(--text-secondary); }
.ui-modal--wide { width: 720px; }
.ui-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ui-modal-title { margin: 0; font-family: var(--font-heading); font-size: 15px; font-weight: 600;
    color: var(--text-primary); }
.ui-modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; }
body.mobile .ui-modal-backdrop { align-items: flex-end; padding: 0; }
body.mobile .ui-modal { width: 100%; max-height: 90vh; border-radius: var(--radius-card, 10px) var(--radius-card, 10px) 0 0; }

/* Dense table: the ui-table look for very wide grids (markets, pro forma). */
table.ui-table.ui-table--dense th { height: 32px; padding: 0 8px; }
table.ui-table.ui-table--dense td { height: 32px; padding: 0 8px; font-size: 12.5px; }

/* Chip: a neutral state chip that says its state in a word. */
.ui-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 12px;
    background: var(--bg-input); color: var(--text-secondary); font-family: var(--font-body);
    font-size: 11.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; }

/* Banner: neutral information (connected, saved, nothing found) in words,
   in place of tinted green / amber boxes. */
.ui-banner { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; box-sizing: border-box;
    border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px);
    background: var(--bg-input); color: var(--text-secondary); font-size: 13px; line-height: 1.45; }
.ui-banner strong { color: var(--text-primary); font-weight: 600; }

/* Page: the page padding and header row of the CRM and Schedule pages. */
.ui-page { padding: 16px 24px 32px; box-sizing: border-box; min-width: 0; }
body.mobile .ui-page { padding: 12px; }
.ui-page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px;
    flex-wrap: wrap; margin-bottom: 12px; }
.ui-page-title { margin: 0; font-family: var(--font-heading); font-size: 20px; font-weight: 600;
    color: var(--text-primary); }
