/* Property card shell (RES_DESIGN_SPEC component 15, deal card rebuild
   stage 1, 2026-11-11): the card takes the table's place in the tracker's
   table row on desktop, the map stays beside it. Geometry only: the card's
   content composes the kit (.ui-card, .ui-pairs, .ui-table, .rk-tag) and
   the page tab strip (.page-tabs). Skin tokens only. */

/* The table steps aside while the card is open (its element stays in the
   page, so its scroll and selection come back with it). */
body:not(.mobile) .tracker-content-row.acw-card-on > .tracker-table-wrapper,
body:not(.mobile) .tracker-content-row.acw-card-on > #rp-table-col,
body:not(.mobile) .tracker-content-row.acw-card-on > #ls-table { display: none !important; }
/* The map keeps its width while a card is open (2026-11-12, owner: on
   Properties the card's wide content squeezed the map to a strip); the card
   takes the table's share (flex basis 0 above). Only Widen covers the map. */
body:not(.mobile) .tracker-content-row.acw-card-on > #tracker-map-panel:not(.collapsed) { flex: 0 0 auto; }
/* Comps tab (2026-11-24, owner): the table outranks the map, so the map
   keeps its pins on a 320 px strip while the tab is open. */
body:not(.mobile) .tracker-content-row.acw-card-on.acw-comps-tab:not(.acw-card-wide) > #tracker-map-panel:not(.collapsed) {
    width: 320px; min-width: 320px; max-width: 320px; flex: 0 0 320px; }
/* Widen: the card spreads over the map; closing brings the map back. */
body:not(.mobile) .tracker-content-row.acw-card-on.acw-card-wide > #tracker-map-panel,
body:not(.mobile) .tracker-content-row.acw-card-on.acw-card-wide > #tracker-map-tab { display: none !important; }

.acw-card { display: none; }
body:not(.mobile) .tracker-content-row.acw-card-on > .acw-card {
    display: flex; flex-direction: column; flex: 1 1 0; min-width: 0;
    height: 600px; min-height: 420px;
    border: 1px solid var(--border-color); border-radius: var(--radius-card, 10px);
    background: var(--bg-card); overflow: hidden; }

.acw-card-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--border-color); }
.acw-card-back, .acw-card-icon { display: inline-flex; align-items: center; gap: 4px; height: 32px;
    padding: 0 12px 0 8px; border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px);
    background: var(--bg-card); color: var(--text-secondary); font: inherit; font-size: var(--fs-base, 13px);
    font-weight: 600; cursor: pointer; flex: none; box-sizing: border-box; }
.acw-card-icon { width: 32px; padding: 0; justify-content: center; }
.acw-card-back:hover, .acw-card-icon:hover { border-color: var(--primary-color); color: var(--primary-color); }
.acw-card-icon[aria-pressed="true"] { background: var(--bg-input); border-color: var(--primary-color); color: var(--primary-color); }
.acw-card-back svg, .acw-card-icon svg { width: 16px; height: 16px; }
.acw-card-titles { flex: 1 1 auto; min-width: 0; }
.acw-card-title { margin: 0; font-size: var(--fs-xl, 20px); font-weight: 700; line-height: 1.25; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acw-card-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-height: 20px; font-size: var(--fs-sm, 12px);
    color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.acw-card-sub .badge { font-size: var(--fs-xs, 11px); padding: 2px 8px; font-weight: 600; }
.acw-card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.acw-card-actions .btn { height: 32px; box-sizing: border-box; display: inline-flex; align-items: center;
    padding: 0 12px; font-size: var(--fs-base, 13px); text-decoration: none; }
.acw-card-status { font-size: var(--fs-sm, 12px); color: var(--text-muted); max-width: 220px; }

/* The tab strip is the card's main navigation: it sits in the header band,
   the one rule under it (polish pass, 2026-11-12: one divider, not two). */
.acw-card-head:has(+ .acw-card-tabs:not(:empty)) { border-bottom: 0; }
.acw-card-tabs { padding: 0 16px 12px; border-bottom: 1px solid var(--border-color); }
.acw-card-tabs:empty { display: none; }
.acw-card-tabs .page-tabs { margin: 0; }
.acw-card-tabs button.page-tab { border: none; cursor: pointer; background: transparent; font-size: var(--fs-base, 13px); }
.acw-card-tabs button.page-tab + button.page-tab { border-left: 1px solid var(--border-color); }
.acw-card-tabs button.page-tab.active { background: var(--primary-color); color: #fff; }

.acw-card-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.acw-card-body .ui-table td { height: 40px; }
/* The street view fills its cell beside the next steps (no band under it). */
.acw-card-photo { width: 100%; height: 100%; min-height: 180px; max-height: 320px; object-fit: cover;
    display: block; border-radius: 8px; background: var(--bg-input); }
.acw-card-body .ui-card.acw-photo-card { padding: 0; overflow: hidden; display: flex; min-height: 180px; }
.acw-card-body .ui-card.acw-photo-card > a { display: flex; flex: 1 1 auto; min-width: 0; }
.acw-card-body .ui-card.acw-photo-card > :not(img):not(a):not(.acw-photo-nav) { margin: auto; padding: 16px; }

/* The card's details disclosure (Full record, Comps used). */
.acw-card-body details > summary { list-style: none; }
.acw-card-body details > summary::-webkit-details-marker { display: none; }
.acw-card-body details[open] > summary { margin-bottom: 8px; }

/* The deal row the card shows stays marked, so the table comes back with
   its place (the Properties table marks its row the same way). */
.tracker-res .tracker-table tbody tr.acw-selected td,
.tracker-shell .tracker-table tbody tr.acw-selected td { background: var(--bg-input) !important; }
.tracker-res .tracker-table tbody tr.acw-selected td:first-child,
.tracker-shell .tracker-table tbody tr.acw-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary-color); }

/* The type picker (stage 4, two or more property types enabled): the
   deal's type beside the header actions, at the control height. */
.acw-card-kind { display: inline-flex; align-items: center; gap: 6px; }
.acw-card-kind .ui-l { margin: 0; white-space: nowrap; }
.acw-card-select { height: 32px; box-sizing: border-box; padding: 0 8px; border: 1px solid var(--border-color);
    border-radius: var(--radius-control, 8px); background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: 12.5px; }

/* The Value card's numbers stay a compact cluster when it takes the row
   (RES_DESIGN_SPEC geometry rule 3). */
.acw-card-body #acw-value .ui-pairs { max-width: 640px; }

/* Deal tabs (stage 3, 2026-11-11): the deal page's own tab, framed below
   the card's tab strip (/deal/<id>?embed=card), filling the card. */
.acw-card-frame { flex: 1 1 auto; min-height: 0; display: flex; }
.acw-card-frame[hidden], .acw-card-body[hidden] { display: none !important; }
.acw-card-iframe { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--bg-card); }
.acw-card-tabs button.page-tab.acw-tab-pending:not(.active) { color: var(--text-muted); }

/* Comps (stage 2): the county comps table; a row hover lights its pin on
   the page map, a click selects it (and a pin click marks its row). */
.acw-comps-card { padding: 0; overflow: hidden; }
.acw-comps-table tbody tr { cursor: pointer; }
.acw-comps-table tbody tr.acw-lit td { background: var(--bg-input); }
.acw-comps-table tbody tr.acw-sel td { background: var(--bg-input); }
.acw-comps-table tbody tr.acw-sel td:first-child { box-shadow: inset 3px 0 0 var(--primary-color); }
.acw-comps-table tbody tr.acw-comp-off td { color: var(--text-muted); }

/* The other view of the same page (Open in Properties / Open in My deals):
   a quiet text link beside the header actions. */
.acw-card-link { border: 0; background: none; padding: 0 4px; font: inherit; font-size: 12.5px;
    font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.acw-card-link:hover { color: var(--primary-color); text-decoration: underline; }

/* A long value in a pair (the broker's email) ends in an ellipsis inside
   its column instead of breaking mid word; the full text is its title. */
.acw-card-body .ui-pairs > div { min-width: 0; }
.acw-card-clip { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* A pair that takes the whole row of its box (the broker's email, the
   listing link: 2026-11-17, owner). */
.acw-card-body .ui-pairs > .acw-pair-wide { grid-column: 1 / -1; }

/* ---- 2026-11-12 owner round (card 2) --------------------------------------
   The Quick view fits the card's real width: one column in the narrow card
   beside the map, two when the map is hidden and the card is wider. */
.acw-card-body { container-type: inline-size; }
.acw-card-body .ui-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (max-width: 760px) {
    .acw-card-body .ui-cards { grid-template-columns: minmax(0, 1fr); }
    .acw-card-body .ui-pairs.ui-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .acw-card-body .acw-card-photo { max-height: 180px; }
}
.acw-card-body .ui-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acw-card-body .ui-pairs.ui-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acw-card-body .ui-card { min-width: 0; overflow-wrap: anywhere; }

/* The stat row: while a card is open the tile row above the table gives
   its slot (same 56px tiles) to the property's figures; Back returns it. */
.acw-card-stats { display: none; }
body.acw-card-open .acw-tiles:not(.acw-card-stats) { display: none !important; }
body.acw-card-open .acw-card-stats { display: flex; overflow: hidden; }
.acw-card-stats > .acw-tile.acw-stat { cursor: default; min-width: 0; flex: 0 1 auto; max-width: 180px; }
.acw-card-stats > .acw-tile.acw-stat:hover { border-color: var(--border-color); color: var(--text-secondary); }
.acw-card-stats .acw-tile-n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Editing in place (2026-11-13, owner): an editable tile or Next row is a
   quiet click target (Enter or Space from the keyboard); the editor is the
   My deals cell input. The phase pill opens the phase menu; the actions
   button holds Archive / Restore and Remove (menus: res_ui.css .tr-ddm). */
.acw-card-stats > .acw-tile.acw-stat.acw-edit { cursor: pointer; }
.acw-card-stats > .acw-tile.acw-stat.acw-edit:hover { border-color: var(--primary-color); }
.acw-card-stats > .acw-tile.acw-stat--primary.acw-edit:hover { border-color: #334155; }
.acw-card-stats > .acw-tile.acw-stat.is-editing .acw-tile-n { overflow: visible; width: 100%; }
.acw-edit:focus-visible, .acw-phase-btn:focus-visible, .acw-card-more:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.acw-edit-empty { color: var(--text-muted); font-weight: 400; }
.acw-edit .inline-edit-input { width: 128px; max-width: 100%; height: 26px; box-sizing: border-box; padding: 0 6px;
    border: 1px solid var(--primary-color); border-radius: 6px; background: var(--bg-card); color: var(--text-primary);
    font: inherit; font-size: var(--fs-base, 13px); font-weight: 500; outline: none; }
/* In a stat tile the editor is the figure itself (11/17): same size and
   weight as the number it replaces, a rule under it, the tile's width held
   by beginEdit so the row does not move. */
.acw-card-stats > .acw-tile.acw-stat.is-editing .inline-edit-input { width: 100%; min-width: 0; height: 20px; min-height: 0;
    line-height: 20px; padding: 0 2px; margin: 0; border: 0; border-bottom: 1px solid var(--primary-color); border-radius: 0;
    background: transparent; color: inherit; font: inherit; text-align: center; }
.acw-card-stats > .acw-tile.acw-stat.is-editing .inline-edit-input[type="date"] { font-size: 12px; }
.acw-next-row.acw-edit { cursor: pointer; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.acw-next-row.acw-edit:hover { background: var(--bg-input); }
.acw-phase-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
    font: inherit; color: var(--text-muted); cursor: pointer; border-radius: 6px; }
.acw-phase-btn:hover { color: var(--text-primary); }
.acw-phase-caret { width: 10px; height: 10px; flex: none; }
.acw-phase-none { color: var(--text-muted); }
.acw-card-more { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
    border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px); background: var(--bg-card);
    color: var(--text-secondary); cursor: pointer; }
.acw-card-more:hover, .acw-card-more[aria-expanded="true"] { color: var(--text-primary); border-color: var(--primary-color); }
.acw-card-more svg { width: 16px; height: 16px; }
.acw-card-menu { min-width: 160px; }
.acw-ddm-divider { height: 1px; margin: 4px 2px; background: var(--border-color); }
.acw-card-menu .tr-ddm-item.tr-menu-danger { color: var(--error-color); }

/* The working record: notes, next steps, tasks, contact. */
.acw-notes-tools { display: inline-flex; align-items: center; gap: 10px; }
.acw-notes-tools .acw-card-status { font-weight: 400; }
.acw-notes-area { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px;
    border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px); padding: 8px 10px;
    font: inherit; font-size: 13px; color: var(--text-primary); background: var(--bg-card); }
.acw-notes-area:focus { outline: none; border-color: var(--primary-color); }
.acw-notes-list { margin-top: 10px; max-height: 260px; overflow-y: auto; }
.acw-note { padding: 6px 0; border-top: 1px solid var(--bg-input); }
.acw-note:first-child { border-top: 0; }
.acw-note-text { font-size: 13px; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.acw-sublist { display: flex; flex-direction: column; }
.acw-subrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 6px 0; border-top: 1px solid var(--bg-input); font-size: 13px; color: var(--text-primary); min-width: 0; }
.acw-sublist > .acw-subrow:first-child { border-top: 0; }
.acw-task { justify-content: flex-start; cursor: pointer; }
.acw-task input { margin: 0; flex: none; }
.acw-task-title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.acw-task-new { display: block; width: 100%; box-sizing: border-box; height: 32px; margin-top: 8px; padding: 0 10px;
    border: 1px solid var(--border-color); border-radius: var(--radius-control, 8px); font: inherit; font-size: 13px;
    background: var(--bg-card); color: var(--text-primary); }
.acw-task-new:focus { outline: none; border-color: var(--primary-color); }
.acw-contact-links { font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }

/* Tables in the card: the kit's dense table, sticky header; on the comps
   table the Average row then the subject stay frozen under the header. */
.acw-table-scroll { max-height: 70vh; overflow: auto; }
.acw-card-body table.ui-table thead th { position: sticky; top: 0; z-index: 2; }
.acw-comps-table tbody tr.acw-row-avg td { position: sticky; top: 32px; z-index: 1; background: var(--bg-card); font-weight: 600; color: var(--text-primary); }
.acw-comps-table tbody tr.acw-row-subj td { position: sticky; top: 64px; z-index: 1; background: var(--bg-card);
    border-bottom: 1px solid var(--border-color); }
.acw-card-body td.acw-wrap { white-space: normal; min-width: 140px; overflow-wrap: anywhere; }

/* Sales: one table; Full record shows the other records in place; names
   wrap instead of clipping. */
.hf-sales td.hf-wrap { white-space: normal; min-width: 120px; overflow-wrap: anywhere; }
.hf-sales-wrap:not(.hf-open) tr.hf-extra { display: none; }

/* The listing card's photos: one at a time, a quiet stepper. */
.acw-card-body .ui-card.acw-photo-card { position: relative; }
.acw-photo-nav { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 2px 6px; font-size: 12px; }
.acw-photo-btn { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text-secondary); padding: 0 4px; }
.acw-photo-btn:hover { color: var(--primary-color); }

/* ---- Polish pass (2026-11-12, owner: sizing, spacing, hierarchy) -----------
   One type scale inside the card, all style.css tokens: the address 20
   (--fs-xl), a section title 16 (--fs-lg), a value 14 (--fs-md), a label,
   a basis line or a note 12 (--fs-sm); tables 13 (--fs-base). One spacing
   rhythm: 16 card padding, 12 between cards and rows, 12/16 between pairs,
   4 from a label to its value. The card's headline figures are the stat
   row's (the first tile framed, the kit's primary stat: a 2px #334155 box,
   res_kit.css .rk-stat--primary); nothing in the card is hero sized. */
.acw-card-body .ui-cards { gap: 12px; }
.acw-card-body .ui-cards + .ui-cards { margin-top: 12px; }
.acw-card-body .ui-card { padding: 16px; }
.acw-card-body .ui-card.acw-photo-card { padding: 0; }
.acw-card-body .ui-card-title { font-size: var(--fs-lg, 16px); margin-bottom: 12px; }
.acw-card-body .ui-pairs { gap: 12px 16px; margin-top: 12px; }
.acw-card-body .acw-first, .acw-card-body .ui-pairs.acw-first { margin-top: 0; }
.acw-card-body .ui-l, .acw-card-body .ui-hero-sub, .acw-card-body .ui-note { font-size: var(--fs-sm, 12px); }
.acw-card-body .ui-v, .acw-card-body .ui-v.ui-v-sm { font-size: var(--fs-md, 14px); margin-top: 4px; }
.acw-card-body .ui-hero-sub { margin-top: 4px; }
.acw-card-body .ui-note { margin-top: 12px; }
.acw-card-body .ui-note.acw-first { margin-top: 0; }
.acw-card-body .acw-title-note { font-weight: 500; }
.acw-card-body table.ui-table td, .acw-card-body table.ui-table.ui-table--dense td { font-size: var(--fs-base, 13px); }
.acw-card-body table.ui-table th { font-size: var(--fs-sm, 12px); }
.acw-card-body [hidden] { display: none !important; }
.acw-notes-list { margin-top: 12px; }
.acw-notes-list:empty { display: none; }
.acw-sublabel { margin: 12px 0 4px; }
#acw-next > .ui-card-title + #acw-milestones:empty + #acw-tasks > .acw-sublabel:first-child { margin-top: 0; }
.acw-task-new { margin-top: 12px; }
#acw-next > .ui-card-title + #acw-milestones:empty + #acw-tasks > .acw-task-new:first-child { margin-top: 0; }
.acw-subrow { padding: 8px 0; }

/* The stat row: every tile one height (the 56px tile), the first one
   framed as the primary figure. */
.acw-card-stats > .acw-tile.acw-stat { padding: 0 16px; }
.acw-card-stats > .acw-tile.acw-stat--primary { border: 2px solid #334155; }
.acw-card-stats > .acw-tile.acw-stat--primary .acw-tile-n { font-weight: 700; }
/* An editable figure reads as an input (11/17): the model convention, inputs
   in blue and derived values in the text color. Derived tiles (price per
   unit, cap rate) keep the text color. */
.acw-card-stats > .acw-tile.acw-stat.acw-edit .acw-tile-n { color: var(--text-input); }
.acw-card-stats > .acw-tile.acw-stat.acw-edit .acw-tile-n .acw-edit-empty { color: var(--text-muted); }
.acw-card-stats > .acw-tile.acw-stat--primary:hover { border-color: #334155; }
/* Labels and values sit close (4px), lines at a steady 1.35 so a pair
   reads as one unit and pairs read apart. */
.acw-card-body .ui-pairs .ui-l, .acw-card-body .ui-pairs .ui-v, .acw-card-body .ui-pairs .ui-hero-sub { line-height: 1.35; }
/* A card with no figures to state yet (a fresh deal with no numbers and no
   county match) gives the slot back instead of leaving an empty band. */
body.acw-card-open .acw-card-stats:empty:not(.is-pending) { display: none; }
/* A wide card (the photo absent, or the map hidden) keeps its rows in a
   readable column: a label never sits 1000px from its value. Tables (the
   sales record) keep the full width. */
.acw-card-body .ui-card.ui-wide > :not([data-hf-body="sales"]) { max-width: 760px; }

/* ---- Owner round, 2026-11-12 (Quick view: photos, notes, scores, next) -----
   Header: the deal name (20), the full street address under it (13, the
   secondary ink), then the phase pill. */
.acw-card-addr { margin-top: 2px; font-size: var(--fs-base, 13px); line-height: 1.35; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acw-card-addr[hidden], .acw-card-sub[hidden] { display: none; }
/* One row (2026-11-13, owner): the address, then the phase pill to its
   right, so the content moves up a line. The address gives way (ellipsis)
   before the pill does. */
.acw-card-addrrow { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 2px; }
.acw-card-addrrow .acw-card-addr { margin-top: 0; flex: 0 1 auto; min-width: 0; }
.acw-card-addrrow .acw-card-sub,
.acw-card-addrrow .acw-card-addr:not([hidden]) + .acw-card-sub { margin-top: 0; flex: none; min-height: 0; }

/* Photos: the photo, arrows on its edges, the count, a thumbnail strip;
   a click opens the fullscreen lightbox. Controls take the card surface
   (no dark overlays). */
.acw-card-body .ui-card.acw-photo-card.acw-gal { flex-direction: column; }
.acw-gal-main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.acw-gal-open { display: flex; flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
.acw-gal .acw-card-photo { height: 240px; min-height: 0; max-height: none; border-radius: 0; }
.acw-gal-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-color);
    border-radius: 50%; background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.acw-gal-arrow svg { width: 16px; height: 16px; }
.acw-gal-arrow:hover { border-color: var(--primary-color); color: var(--primary-color); }
.acw-gal-prev { left: 8px; }
.acw-gal-next { right: 8px; }
.acw-gal-n { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--bg-card); font-size: var(--fs-sm, 12px); color: var(--text-secondary);
    font-variant-numeric: tabular-nums; }
.acw-gal-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; border-top: 1px solid var(--border-color); flex: none; }
.acw-gal-thumb { flex: none; width: 64px; height: 44px; padding: 0; border: 2px solid transparent; border-radius: 6px;
    background: var(--bg-input); cursor: pointer; overflow: hidden; }
.acw-gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acw-gal-thumb.is-on { border-color: var(--primary-color); }
.acw-gal-thumb:not(.is-on):hover { border-color: var(--border-color); }
@container (max-width: 760px) { .acw-gal .acw-card-photo { height: 200px; } }

/* Next: label left, the date and its days right; tasks under, the add row
   last (title, date, Add on one 32px line). */
.acw-next-label { color: var(--text-secondary); }
.acw-next-val { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
#acw-next-facts + #acw-milestones > .acw-sublist, #acw-next-facts ~ #acw-tasks > .acw-tasks-list,
#acw-milestones:not(:empty) ~ #acw-tasks > .acw-tasks-list { border-top: 1px solid var(--bg-input); }
.acw-task-meta { margin-left: auto; white-space: nowrap; }
.acw-task-add { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
#acw-next > .ui-card-title + #acw-milestones:empty + #acw-tasks > .acw-task-add:first-child { margin-top: 0; }
.acw-task-add .acw-task-new { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.acw-task-due { flex: none; width: 140px; height: 32px; box-sizing: border-box; padding: 0 8px; border: 1px solid var(--border-color);
    border-radius: var(--radius-control, 8px); font: inherit; font-size: 13px; background: var(--bg-card); color: var(--text-primary); }
.acw-task-due:focus { outline: none; border-color: var(--primary-color); }
.acw-task-btn { flex: none; height: 32px; padding: 0 12px; font-size: var(--fs-base, 13px); }

/* Notes: the add box, then dated, authored entries, newest first; the
   deal's notes text last, whole. */
.acw-note { padding: 10px 0; }
.acw-note-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.acw-notes-list { max-height: 420px; margin: 12px -6px 0; padding: 0 6px; }

/* Notes and calls (2026-11-13): the type segment and the With list above
   the add box (the tracker's quiet segment, the kit select), Pinned first,
   then the stream with its All / Calls / Notes segment. An entry is edited
   where it reads (owner round 2, 2026-11-13: no box, nothing moves): the
   same padding, font and line height in every state; a faint tint and the
   text cursor on hover say it is editable, a slightly deeper tint and the
   caret while typing. The heading edits the same way. The add box stays
   folded behind a small + Add note until it is used. */
.acw-notes-kinds { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.acw-notes-kinds:empty { display: none; }
.acw-seg { display: inline-flex; align-items: center; height: 32px; box-sizing: border-box; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--bg-input); padding: 2px; gap: 2px; }
.acw-seg-btn { height: 26px; box-sizing: border-box; padding: 0 10px; border: 0; border-radius: 6px; cursor: pointer;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; line-height: 1;
    background: transparent; color: var(--text-secondary); }
.acw-seg-btn:not(.is-active):hover { color: var(--text-primary); }
.acw-seg-btn.is-active { background: var(--bg-card); color: var(--primary-color); box-shadow: 0 0 0 1px var(--border-color); }
.acw-seg-btn:focus-visible { outline: 2px solid var(--border-focus, var(--primary-color)); outline-offset: 1px; }
.acw-notes-with { flex: 1 1 180px; max-width: 280px; font-size: 13px; }
.acw-notes-sub { margin-top: 0; }
.acw-notes-sub + .acw-note, .acw-notes-filter + .acw-note { border-top: 0; }
.acw-notes-pinned:empty { display: none; }
.acw-notes-pinned:not(:empty) + .acw-notes-stream:not(:empty) { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.acw-notes-filter { margin: 4px 0 2px; }
.acw-note-kind { color: var(--text-primary); font-weight: 600; }
.acw-note-pin { flex: none; color: var(--text-secondary); }
.acw-note-live { margin: 0 -6px; padding: 2px 6px; border: 0; border-radius: 6px; cursor: text;
    caret-color: var(--primary-color); transition: background-color var(--transition-fast, .15s); }
.acw-note-live:hover { background: var(--bg-hover, var(--bg-input)); }
.acw-note-live:focus, .acw-note-live:focus-visible { outline: none; background: var(--bg-input); }
.acw-note-title { margin: 0 -3px; padding: 0 3px; border-radius: 4px; cursor: text; caret-color: var(--primary-color);
    transition: background-color var(--transition-fast, .15s); }
.acw-note-title:hover { background: var(--bg-hover, var(--bg-input)); }
.acw-note-title:focus, .acw-note-title:focus-visible { outline: none; background: var(--bg-input); }
.acw-note-edited { white-space: nowrap; }
.acw-notes-addbtn { height: 26px; padding: 0 8px; font-size: 12.5px; color: var(--text-secondary); }
.acw-notes-addbtn[hidden], .acw-notes-add[hidden] { display: none; }

/* Scores: one row geometry for the overall, the sections and their
   categories (name, a bar in the one ink, the number); a section opens to
   its categories in place. */
.acw-score-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 40%) 40px; align-items: center; gap: 12px;
    padding: 8px 0; font-size: var(--fs-base, 13px); color: var(--text-primary); }
.acw-score-name { min-width: 0; }
.acw-score-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.acw-score-bar { display: block; height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; }
.acw-score-bar > i { display: block; height: 100%; background: var(--primary-color); }
.acw-score-overall { border-bottom: 1px solid var(--border-color); padding-top: 0; }
.acw-score-overall .acw-score-n { font-size: var(--fs-lg, 16px); font-weight: 700; }
.acw-score-sec { border-bottom: 1px solid var(--bg-input); }
.acw-score-sec:last-child { border-bottom: 0; }
.acw-score-sec > summary.acw-score-row { cursor: pointer; list-style: none; }
.acw-card-body .acw-score-sec[open] > summary { margin-bottom: 0; }
.acw-score-sec > summary .acw-score-name::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0;
    border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform 120ms; }
.acw-score-sec[open] > summary .acw-score-name::before { transform: rotate(45deg); }
.acw-score-cats { padding: 0 0 8px 14px; }
.acw-score-cat { padding: 6px 0; }
/* The row under the pointer lights up (2026-11-20, owner: "if u hover over a
   category should the whole bar highlight ... hard to see differentiating
   between them"); the open category keeps the tint. */
.acw-score-row { border-radius: 6px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; transition: background .12s; }
.acw-score-row:hover, .acw-score-cat-d[open] > summary.acw-score-cat { background: var(--bg-hover, #F3F4F6); }
.acw-card-link[data-acw="open-folder"] { background: none; border: 0; cursor: pointer; font: inherit; }
.acw-plain { color: inherit; text-decoration: none; }
.acw-plain:hover { color: var(--primary-color); text-decoration: underline; }
.acw-score-cat .acw-score-n { font-weight: 500; }
/* the fill's opacity is set inline from the score (scoreBar) */
.acw-score-basis { display: block; margin-top: 2px; }
.acw-score-missing { padding: 4px 0 0; }
/* The data behind a category (2026-11-17): a label and value table under
   the row, closed until opened; the row's name carries the same marker
   as a section. */
.acw-score-cat-d > summary.acw-score-cat { cursor: pointer; list-style: none; }
.acw-score-cat-d > summary::-webkit-details-marker { display: none; }
.acw-score-cat-d > summary .acw-score-name::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 8px 2px 0;
    border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform 0.15s; }
.acw-score-cat-d[open] > summary .acw-score-name::before { transform: rotate(45deg); }
.acw-score-detail { width: 100%; max-width: 520px; border-collapse: collapse; margin: 2px 0 10px 13px; font-size: var(--fs-sm, 12px); }
.acw-score-detail th { text-align: left; font-weight: 500; color: var(--text-muted); padding: 3px 12px 3px 0; vertical-align: top; }
.acw-score-detail td { text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; padding: 3px 0; white-space: nowrap; }

/* The gallery fills its card edge to edge (the photo card's generic
   centering rule above is for a lone note, not the gallery). */
.acw-card-body .ui-card.acw-photo-card.acw-gal > .acw-gal-main { margin: 0; padding: 0; }
.acw-card-body .ui-card.acw-photo-card.acw-gal > .acw-gal-thumbs { margin: 0; padding: 8px; }
.acw-gal-open .acw-card-photo { width: 100%; }
/* Scores use the card's width (no dead space at 1440): the bar column
   takes 40% of the row, so a name, its bar and its number stay one read. */
.acw-card-body .ui-card.ui-wide#acw-scores > * { max-width: none; }
/* The top row: Next (or the estimate) sizes to its content, top aligned,
   instead of stretching to the photo's height. */
.acw-card-body #acw-top { align-items: start; }

/* Phases and History (2026-11-13): the phase steps with their dates, a
   date edited in place; History closes to its title and count, last on the
   Quick view. Quiet ink only: the existing sublist rows and link buttons. */
.acw-phase-name { font-weight: 600; }
.acw-phase-meta { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.acw-phase-edit { display: inline-flex; align-items: center; gap: 8px; }
.acw-phase-removing .acw-phase-edit { flex-wrap: wrap; }
.acw-phase-ask { font-size: 13px; color: var(--text-secondary); }
.acw-phase-add .acw-phase-pick { padding: 0 8px; }
.acw-hist > summary.acw-hist-head { cursor: pointer; list-style: none; margin-bottom: 0; justify-content: flex-start; }
.acw-hist > summary.acw-hist-head .acw-title-note { margin-left: 2px; }
.acw-hist > summary.acw-hist-head::-webkit-details-marker { display: none; }
.acw-hist > summary.acw-hist-head::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0;
    border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform 120ms; }
.acw-hist[open] > summary.acw-hist-head::before { transform: rotate(45deg); }
.acw-hist[open] > summary.acw-hist-head { margin-bottom: 8px; }
.acw-hist-row { padding: 7px 0; border-top: 1px solid var(--bg-input); font-size: 13px; color: var(--text-primary); overflow-wrap: anywhere; }
.acw-hist-list > .acw-hist-row:first-child { border-top: 0; }
.acw-hist-items { margin: 4px 0 0; padding: 0 0 0 14px; }
.acw-hist-items > li { padding: 2px 0; }
.acw-hist-when { white-space: nowrap; }
.acw-hist-more { margin-top: 8px; }
