/* Styles for the inventory pages (projects, project page, plan templates). Neravo look. */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proj-card { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 16px; align-content: start; cursor: pointer; box-shadow: 0 1px 2px rgba(20,20,28,.04); }
.proj-card:hover { border-color: var(--c-select-line); box-shadow: 0 4px 14px rgba(54,52,61,.08); }
.proj-card.archived { opacity: .6; }
.proj-top { display: flex; gap: 12px; align-items: flex-start; }
.proj-title { flex: 1; min-width: 0; display: grid; gap: 6px; }
.proj-name { font-size: var(--fs-section); font-weight: var(--fw-semibold); color: var(--c-ink); text-decoration: none; overflow-wrap: anywhere; }
.proj-name:hover { text-decoration: underline; }
.proj-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proj-loc { display: inline-flex; gap: 4px; align-items: center; color: var(--c-muted); font-size: var(--fs-hint); }
.proj-loc .ico { width: 14px; height: 14px; }
.proj-ico { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--c-tile); color: var(--c-ink); display: grid; place-items: center; flex-shrink: 0; }
.proj-ico .ico { width: 24px; height: 24px; }
.proj-ico.big { width: 80px; height: 80px; border-radius: var(--r-lg); }
.proj-ico.big .ico { width: 36px; height: 36px; }
.proj-progress { display: grid; gap: 6px; font-size: var(--fs-table); color: var(--c-muted); }
.proj-row { display: flex; justify-content: space-between; gap: 8px; }
.proj-row b { color: var(--c-ink); }
.inv-progress { height: 8px; border-radius: 5px; background: var(--c-neutral-soft); overflow: hidden; }
.inv-progress i { display: block; height: 100%; background: var(--c-ink); border-radius: 5px; }
.proj-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 14px; border-top: 1px solid var(--c-line); font-size: var(--fs-table); color: var(--c-muted); }
.proj-vals b { display: block; margin-top: 3px; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-ink); }

/* Notes, filter card, section heads (shared by projects, project page, plan templates) */
.inv-note { margin: 0 0 14px; font-size: var(--fs-table); color: var(--c-muted); }
.inv-note summary { cursor: pointer; }
.inv-note summary:hover { color: var(--c-accent-text); } /* hover (said-once #4, 2026-11-14) */
.inv-note p { margin: 6px 0 0; }
.inv-filters { padding: 16px; margin-bottom: 14px; overflow: visible; }
.inv-filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.inv-filter-row select, .inv-search, .inv-range input, .inv-sort select { font: inherit; font-size: var(--fs-body); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink); }
.inv-filter-row select, .inv-sort select { padding: 9px 12px; min-width: 150px; flex: 0 1 auto; }
.inv-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--c-muted); }
.inv-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; padding: 9px 0; color: var(--c-ink); }
.inv-search:focus-within, .inv-filter-row select:focus-visible, .inv-range input:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 1px; }
.inv-filter-foot { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-line); }
.inv-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--fs-table); color: var(--c-muted); }
.inv-range input { width: 120px; padding: 9px 12px; }
.inv-sort { display: flex; gap: 8px; align-items: center; font-size: var(--fs-table); color: var(--c-muted); }
.inv-count { margin: 4px 0 12px; }
.inv-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; }
.inv-section-head h2 { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); display: flex; gap: 8px; align-items: center; }
.inv-section-head h2 .ico { color: var(--c-ink); width: 22px; height: 22px; }
.inv-section-head p { margin: 4px 0 0; font-size: var(--fs-body); }
.inv-foot { margin-top: 12px; }
.inv-bar { display: grid; gap: 8px; margin-bottom: 16px; }
.inv-explain { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 14px; color: var(--c-ink); box-shadow: var(--card-shadow); }
.inv-explain p { margin: 6px 0 0; color: var(--c-muted); line-height: 1.6; font-size: var(--fs-body); }
.ink { color: var(--c-ink); }
.sel-col { width: 30px; }

/* Project page header and tabs */
.inv-back { display: inline-flex; gap: 8px; align-items: center; color: var(--c-ink); text-decoration: none; font-size: var(--fs-body); }
.inv-back:hover { text-decoration: underline; }
.proj-hero { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.proj-hero-text { flex: 1 1 280px; min-width: 0; }
.proj-hero h1 { margin: 0 0 6px; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); overflow-wrap: anywhere; }
.proj-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; color: var(--c-muted); font-size: var(--fs-body); }
.proj-meta .ico { width: 14px; height: 14px; vertical-align: -2px; }
.proj-desc { margin: 10px 0 0; font-size: var(--fs-section); color: var(--c-text); }
.inv-tabs { display: flex; max-width: 100%; margin-bottom: 18px; } /* full width line under the tabs (#306) */

/* Phases tab: summary line, then one card per phase (order, state, units by state, delivery + maintenance, actions) */
.ph-summary { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: -4px 0 16px; font-size: var(--fs-table); color: var(--c-muted); }
.ph-summary b { color: var(--c-ink); font-size: var(--fs-body); margin-inline-end: 3px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.ph-card { position: relative; display: grid; gap: 16px; padding: 20px 20px 16px; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(20,20,28,.04); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.ph-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c-ink); }
.ph-card.closed::before { background: var(--c-line-strong); }
.ph-card:hover { border-color: var(--c-select-line); box-shadow: 0 6px 18px rgba(20,20,28,.06); }
.ph-head { display: flex; align-items: center; gap: 12px; }
.ph-step { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-select); color: var(--c-ink); font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.ph-card.closed .ph-step { background: var(--c-tile); color: var(--c-muted); }
.ph-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ph-title h3 { margin: 0; font-size: var(--fs-section); font-weight: var(--fw-semibold); color: var(--c-ink); overflow-wrap: anywhere; }
.ph-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-hint); font-weight: var(--fw-semibold); white-space: nowrap; }
.ph-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ph-state.open { background: var(--c-success-soft); color: var(--c-success); }
.ph-state.closed { background: var(--c-tile); color: var(--c-muted); }
.ph-units { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--c-page); }
.ph-units-n { display: grid; justify-items: center; line-height: 1.1; min-width: 56px; }
.ph-units-n b { font-size: var(--fs-kpi); font-weight: var(--fw-semibold); color: var(--c-ink); }
.ph-units-n span { font-size: var(--fs-hint); color: var(--c-muted); }
.ph-units-bar { flex: 1; min-width: 0; display: grid; gap: 8px; }
.ph-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-hint); color: var(--c-text); }
.ph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ph-legend i { width: 8px; height: 8px; border-radius: 2px; }
.ph-facts { margin: 0; display: grid; gap: 10px; }
.ph-facts > div { display: grid; grid-template-columns: 128px 1fr; gap: 10px; align-items: baseline; }
.ph-facts dt { display: flex; align-items: center; gap: 6px; font-size: var(--fs-table); color: var(--c-muted); }
.ph-facts dt .ico { width: 15px; height: 15px; }
.ph-facts dd { margin: 0; font-size: var(--fs-body); color: var(--c-ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ph-facts dd small { order: 3; flex-basis: 100%; font-size: var(--fs-hint); color: var(--c-faint); }
.ph-facts dd .link { margin-inline-start: auto; }
.ph-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--c-line); }
.ph-acts { margin-inline-start: auto; display: flex; gap: 2px; }
.ph-acts .ico { width: 16px; height: 16px; }
.ph-acts .fx-grip { height: 28px; }
@media (max-width: 860px) {
  .ph-grid { grid-template-columns: 1fr; }
  .ph-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .ph-facts dd .link { margin-inline-start: 0; }
}
.chip { border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); padding: 3px 10px; font-size: var(--fs-hint); color: var(--c-ink); }

/* Stacked status bar */
.inv-statbar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--c-neutral-soft); }
.inv-statbar i { display: block; height: 100%; }
.ust-available { background: var(--us-available); }
.ust-on_hold { background: var(--us-on_hold); }
.ust-pending_reservation { background: var(--us-pending_reservation); }
.ust-reserved { background: var(--us-reserved); }
.ust-sold { background: var(--us-sold); }
.ust-blocked { background: var(--us-blocked); }
.ust-under_review { background: var(--us-under_review); }
.inv-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-hint); color: var(--c-muted); }
.inv-legend span { display: inline-flex; align-items: center; gap: 5px; }
.inv-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* Stat tiles on the project page */
.inv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.inv-stats .stat { padding: 12px 14px; }
.inv-stats .stat .value { font-size: var(--fs-kpi); }

/* Phases */
.inv-phase-list { display: grid; }
.inv-phase-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--c-line); font-size: var(--fs-table); }
.inv-phase-row:last-child { border-bottom: 0; }
.inv-phase-row b { color: var(--c-ink); }
.inv-phase-row .acts { display: flex; gap: 2px; }

/* Units board */
.inv-board { display: grid; gap: 18px; padding: 14px; }
.inv-building h4 { margin: 0 0 8px; font-size: var(--fs-table); color: var(--c-ink); }
.inv-floor { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: start; margin-bottom: 6px; }
.inv-floor .fl { font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-faint); padding-top: 9px; text-transform: uppercase; letter-spacing: .5px; }
.inv-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-tile { min-width: 74px; border-radius: var(--r-md); padding: 6px 8px; font-size: var(--fs-hint); cursor: pointer; border: 1px solid transparent; color: var(--c-card); text-align: start; font: inherit; line-height: 1.3; }
.inv-tile b { display: block; font-size: var(--fs-hint); }
.inv-tile small { opacity: .9; font-size: var(--fs-hint); }
.inv-tile.ust-available { background: var(--us-available-soft); color: var(--us-available-ink); border-color: var(--us-available-line); }
.inv-tile.ust-on_hold { background: var(--us-on_hold-soft); color: var(--us-on_hold-ink); border-color: var(--us-on_hold-line); }
.inv-tile.ust-pending_reservation { background: var(--us-pending_reservation-soft); color: var(--us-pending_reservation-ink); border-color: var(--us-pending_reservation-line); }
.inv-tile.ust-reserved { background: var(--us-reserved-soft); color: var(--us-reserved-ink); border-color: var(--us-reserved-line); }
.inv-tile.ust-sold { background: var(--us-sold-soft); color: var(--us-sold-ink); border-color: var(--us-sold-line); }
.inv-tile.ust-blocked { background: var(--us-blocked-soft); color: var(--us-blocked-ink); border-color: var(--us-blocked-line); }
.inv-tile.ust-under_review { background: var(--us-under_review-soft); color: var(--us-under_review-ink); border-color: var(--us-under_review-line); }
.inv-tile.sel { outline: 2px solid var(--c-ink); outline-offset: 1px; }
.inv-tile:hover { filter: brightness(.95); box-shadow: var(--card-shadow); }
.inv-view-toggle { display: inline-flex; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; }
.inv-view-toggle button { font: inherit; font-size: var(--fs-hint); font-weight: var(--fw-semibold); border: 0; background: var(--c-card); padding: 6px 12px; cursor: pointer; color: var(--c-muted); }
.inv-view-toggle button.on { background: var(--c-ink); color: var(--c-card); }
.inv-view-toggle button:not(.on):hover { background: var(--c-select-line); color: var(--c-ink); }

/* Import preview */
.inv-import-preview { max-height: 360px; overflow: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); margin-top: 10px; }
.inv-import-preview td.err { color: var(--c-danger); white-space: normal; min-width: 180px; }
.inv-import-preview tr.bad td { background: var(--c-danger-soft); }
.inv-hint { background: var(--c-tile); border: 1px dashed var(--c-select-line); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-hint); color: var(--c-muted); line-height: 1.6; }
.inv-hint code { background: var(--c-select); padding: 1px 5px; border-radius: 4px; color: var(--c-text); }

/* Unit page (#/units/<id>) */
.unit-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.unit-head .price { font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); }
.unit-section { margin-top: 16px; }
.unit-section h4 { margin: 0 0 8px; font-size: var(--fs-hint); text-transform: uppercase; letter-spacing: .6px; color: var(--c-faint); }
.holder-box { background: var(--c-info-soft); border: 1px solid var(--c-info-line); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-table); color: var(--c-info); }
.block-box { background: var(--c-neutral-soft); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-table); color: var(--c-ink); margin-top: 10px; }
.review-box { background: var(--teal-soft); border: 1px solid var(--teal-line); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-table); color: var(--c-ink); margin-top: 10px; }
.review-box b { color: var(--teal); }
.unit-files { display: grid; gap: 6px; }
.unit-files div { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: var(--fs-table); }

@media (max-width: 860px) {
  .inv-phase-row { grid-template-columns: 1fr auto; }
  .proj-grid, .unit-grid { grid-template-columns: 1fr; }
  .inv-filter-row select, .inv-range input { flex: 1 1 140px; min-width: 0; }
  .proj-ico.big { width: 56px; height: 56px; }
}
.inv-link { text-decoration: none; }

/* Unit cards (project page) */
.inv-view-toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
/* Unit card (Sami 2026-11-04; calmer 2026-11-16, look "A + pill", prototype docs/prototypes/unit-cards/): the number + state on top, two key figures with icons, perks as grey chips,
   the price at the foot on white under a thin line. The state colour lives in two places only: the thin line on top and the State pill (soft fill + its own ink). Everything else is neutral. */
.uc { --st: var(--c-neutral); --st-soft: var(--c-neutral-soft); position: relative; display: flex; flex-direction: column; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); cursor: pointer; overflow: hidden; box-shadow: 0 1px 2px rgba(20,20,28,.04); transition: border-color .18s, box-shadow .18s, transform .18s; }
.uc::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--st); }
.uc > * { position: relative; }
.uc:hover { border-color: var(--c-select-line); box-shadow: 0 14px 32px rgba(20,20,28,.10); transform: translateY(-3px); }
.uc:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }
.uc:has(input[data-sel]:checked) { border-color: var(--c-ink); box-shadow: var(--focus-ring); }
.uc.st-available { --st: var(--us-available); --st-soft: var(--us-available-soft); --st-ink: var(--us-available-ink); }
.uc.st-on_hold { --st: var(--us-on_hold); --st-soft: var(--us-on_hold-soft); --st-ink: var(--us-on_hold-ink); }
.uc.st-pending_reservation { --st: var(--us-pending_reservation); --st-soft: var(--us-pending_reservation-soft); --st-ink: var(--us-pending_reservation-ink); }
.uc.st-reserved { --st: var(--us-reserved); --st-soft: var(--us-reserved-soft); --st-ink: var(--us-reserved-ink); }
.uc.st-sold { --st: var(--us-sold); --st-soft: var(--us-sold-soft); --st-ink: var(--us-sold-ink); }
.uc.st-under_review { --st: var(--us-under_review); --st-soft: var(--us-under_review-soft); --st-ink: var(--us-under_review-ink); }
.uc.st-blocked { --st: var(--us-blocked); --st-soft: var(--us-blocked-soft); --st-ink: var(--us-blocked-ink); }
.uc-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 18px 0; }
.uc-head input[data-sel] { flex: none; margin: 6px 0 0; width: 16px; height: 16px; accent-color: var(--c-ink); cursor: pointer; /* hover: native control */ }
.uc-status { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--st-soft); border: 1px solid transparent; color: var(--st-ink, var(--c-neutral)); font-size: var(--fs-hint); font-weight: var(--fw-semibold); white-space: nowrap; }
.uc-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 3px var(--st-soft); }
.uc-id { flex: 1; display: grid; gap: 3px; min-width: 0; }
.uc-id h3 { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); letter-spacing: -.5px; line-height: 1.15; color: var(--c-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.uc-id span { font-size: var(--fs-table); color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-facts { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 18px 18px 0; padding: 0; }
.uc-facts li { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; border-inline-start: 1px solid var(--c-line); white-space: nowrap; }
.uc-facts li:first-child { justify-content: flex-start; border-inline-start: 0; }
.uc-facts li:last-child:not(:first-child) { justify-content: flex-end; }
.uc-facts .ico { flex: none; width: 18px; height: 18px; color: var(--c-muted); }
.uc-facts b { font-size: var(--fs-section); font-weight: var(--fw-semibold); letter-spacing: -.3px; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.uc-facts span { font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); }
.uc-perks { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 18px 0; }
.uc-perks span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-md); background: var(--c-page); border: 1px solid var(--c-line); font-size: var(--fs-hint); font-weight: var(--fw-medium); color: var(--c-text); }
.uc-perks .ico { width: 13px; height: 13px; color: var(--c-muted); }
/* The chips are grey, the view (what the buyer sees, always first) included (Sami 2026-11-16: the state colour stays on the line on top and the pill only). */
.uc-band { margin-top: auto; padding-top: 16px; }
.uc-price { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 18px 16px; border-top: 1px solid var(--c-line); } /* white under a thin line; the price itself carries the weight (Sami 2026-11-16) */
.uc-total { display: grid; gap: 1px; min-width: 0; flex: 1; }
.uc-total span, .uc-price.none span { font-size: var(--fs-hint); color: var(--c-muted); }
.uc-total b { font-size: var(--fs-title); font-weight: var(--fw-semibold); letter-spacing: -.4px; color: var(--c-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.uc-total b i { font-style: normal; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); margin-inline-start: 4px; }
.uc-total small { font-size: var(--fs-hint); color: var(--c-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-ppm { flex: none; padding-bottom: 3px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.uc-ppm span { font-weight: var(--fw-medium); color: var(--c-faint); }
.uc-price.none { display: grid; gap: 1px; }
.uc-price.none b { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-faint); }
.uc-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--c-line); min-width: 0; }
.uc-foot .grow { flex: 1; }
.uc-avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c-neutral-soft); color: var(--c-muted); font-size: var(--fs-hint); font-weight: var(--fw-semibold); }
.uc-holder { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.uc-holder[dir="auto"] { text-align: left; } /* an Arabic lead name lines up like an English one (said-once #26) */
[dir="rtl"] .uc-holder[dir="auto"] { text-align: right; }
.uc-holder b { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-holder small { font-size: var(--fs-hint); color: var(--c-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .uc, .uc:hover { transition: none; transform: none; } }

.chip-btn .chip-n { min-width: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--c-neutral-soft); color: var(--c-muted); font-size: var(--fs-hint); font-weight: var(--fw-semibold); text-align: center; line-height: 18px; }
.chip-btn.on .chip-n { background: rgba(255,255,255,.18); color: #fff; }

/* Block and phase dialogs */
.preview-list { margin: 4px 0 0; padding-inline-start: 20px; font-size: var(--fs-table); }
.warn-line { color: var(--c-warning); }
.pick-list { display: grid; gap: 8px; max-height: 340px; overflow: auto; }

/* Wave 2a: buildings tab, building page, new-building wizard, sheet editor, project settings */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-btn { font: inherit; font-size: var(--fs-table); display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border: 1px solid var(--c-line-strong); border-radius: var(--r-pill); background: var(--c-card); color: var(--c-ink); cursor: pointer; }
.chip-btn:hover { border-color: var(--c-select-line); }
.chip-btn.on { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-card); }
.chip-btn:focus-visible, .bp-fl:focus-visible, .bp-bld:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 1px; }

.bld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bld-card { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 10px; align-content: start; box-shadow: 0 1px 2px rgba(20,20,28,.04); }
.bld-card:hover { border-color: var(--c-select-line); }
.bld-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bld-code { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); overflow-wrap: anywhere; }
.bld-foot { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--c-line); }
.bld-foot .btn { text-decoration: none; }

dialog.modal.xwide { width: min(1240px, 96vw); }

/* Building page */
.bp { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.bp-side { display: grid; gap: 12px; position: sticky; top: calc(var(--head-h, var(--topbar-h)) + 12px); /* under the sticky title row, never behind it (#395) */ }
.bp-list { display: grid; gap: 6px; }
.bp-bld { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink); text-decoration: none; }
.bp-bld small { color: var(--c-muted); font-size: var(--fs-hint); }
.bp-bld:hover { border-color: var(--c-select-line); }
.bp-bld.on { border-color: var(--c-ink); background: var(--c-select); }
.bp-main { min-width: 0; }
.bp-crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: var(--fs-table); color: var(--c-muted); margin-bottom: 8px; }
.bp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bp-head h1 { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); }
.bp-head h1 small { font-size: var(--fs-body); font-weight: 400; color: var(--c-muted); }
.bp-head p { margin: 4px 0 0; }
.bp-legend { display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.bp-grid { padding: 14px; overflow-x: auto; }
.bp-floor { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--c-line); min-width: min-content; }
.bp-floor:last-child { border-bottom: 0; }
.bp-fl-col { display: grid; gap: 2px; justify-items: start; position: sticky; left: 0; background: var(--c-card); }
.bp-fl { font: inherit; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); background: none; border: 0; padding: 6px 4px; text-align: start; cursor: pointer; display: grid; border-radius: var(--r-sm); }
.bp-fl:hover:not(:disabled) { background: var(--c-neutral-soft); }
.bp-fl:disabled { cursor: default; }
.bp-fl small { font-weight: 400; color: var(--c-muted); font-size: var(--fs-hint); }
.bp-floor-tools { display: flex; gap: 0; }
.bp-floor-tools .btn { padding: 2px 6px; font-size: var(--fs-hint); }
.bp-tiles { display: flex; gap: 6px; flex-wrap: nowrap; }
.bp-tile { min-width: 118px; display: grid; gap: 1px; align-content: start; }
.bp-tile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; min-height: 13px; }
.inv-tile.cur { box-shadow: 0 0 0 2px var(--c-ink); }
.bp-panel { width: 300px; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 16px; position: sticky; top: calc(var(--head-h, var(--topbar-h)) + 12px); display: grid; gap: 12px; box-shadow: var(--card-shadow); }
.bp-panel[hidden] { display: none; }
.bp-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bp-panel-head h2 { margin: 0 0 6px; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); overflow-wrap: anywhere; }
.bp-kv { grid-template-columns: 110px 1fr; font-size: var(--fs-table); }
.bp-panel-foot { display: flex; gap: 8px; flex-wrap: wrap; }

/* Wizard */
.wz { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.wz-h { margin: 16px 0 6px; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-ink); }
.wz-right { position: sticky; top: 0; }
.wz-right .wz-h { margin-top: 0; }
.wz-row { border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 8px 12px 12px; margin: 0 0 10px; min-width: 0; }
.wz-row legend { font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); padding: 0 4px; }
.wz-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; align-items: end; }
.wz-cells label { display: grid; gap: 4px; font-size: var(--fs-hint); font-weight: var(--fw-medium); color: var(--c-ink); min-width: 0; }
.wz-cells input:not([type=checkbox]), .wz-cells select { font: inherit; font-size: var(--fs-table); padding: 7px 8px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: #fff; color: var(--c-ink); width: 100%; min-width: 0; }
.wz-flags { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-hint); color: var(--c-ink); }
.wz-group { border: 1px solid var(--c-line-strong); border-radius: var(--r-md); padding: 10px 12px 2px; margin: 0 0 12px; background: var(--c-page); }
.wz-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: var(--fs-body); color: var(--c-ink); }
.wz-group-fields { margin-bottom: 10px; }
.wz-group .wz-row { background: var(--c-card); }
.wz-plan { display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.wz-tile { min-width: 96px; cursor: default; }
.wz-info { background: var(--c-neutral-soft); border: 1px solid var(--c-line); color: var(--c-ink); border-radius: var(--r-md); padding: 8px 12px; font-size: var(--fs-table); margin: 0 0 10px; }
.wz-warn { background: var(--c-danger-soft); border: 1px solid var(--c-danger-line); color: var(--c-danger); border-radius: var(--r-md); padding: 8px 12px; font-size: var(--fs-table); margin: 0 0 10px; }

/* Sheet editor */
.sh-head h1 { margin: 6px 0 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-ink); }
.sh-head p { margin: 4px 0 0; }
.sh-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin: 12px 0; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); font-size: var(--fs-body); box-shadow: var(--card-shadow); }
.sh-bar .grow { flex: 1; }
.sh-bad-text { color: var(--c-danger); }
.sh-wrap { overflow: auto; max-height: calc(100vh - 230px); }
.sh-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: var(--fs-table); }
.sh-table th { position: sticky; top: 0; z-index: 2; background: var(--c-page); text-align: start; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); padding: 8px; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.sh-table th.sticky, .sh-td.sticky { position: sticky; left: 0; z-index: 3; background: var(--c-card); }
.sh-table th.sticky { background: var(--c-page); z-index: 4; }
.sh-table tr.sh-group th { position: static; background: var(--c-neutral-soft); color: var(--c-ink); font-size: var(--fs-hint); }
.sh-td { padding: 0; border-bottom: 1px solid var(--c-line); border-inline-end: 1px solid var(--c-line); background: var(--c-card); min-width: 84px; }
.sh-td.num { padding: 0 8px; text-align: end; font-variant-numeric: tabular-nums; }
.sh-td .badge { margin: 3px 6px; }
.sh-td input:not([type=checkbox]), .sh-td select { font: inherit; font-size: var(--fs-table); width: 100%; min-width: 120px; padding: 7px 8px; border: 0; border-radius: 0; background: transparent; color: var(--c-ink); box-shadow: none; text-align: start; }
.sh-td input[type=checkbox] { margin: 8px 12px; }
.sh-td input:focus, .sh-td select:focus { outline: 2px solid var(--c-ink); outline-offset: -2px; box-shadow: none; }
.sh-td.sh-changed, .sh-td.sh-changed.sticky { background: var(--c-warning-soft); }
.sh-td.sh-bad, .sh-td.sh-bad.sticky { background: var(--c-danger-soft); box-shadow: inset 0 0 0 1px var(--c-danger); }
.sh-td.sh-sel { background: var(--c-info-soft); }
.sh-pop { position: fixed; z-index: 50; background: var(--c-card); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); padding: 12px; box-shadow: 0 8px 24px rgba(20,20,28,.18); min-width: 210px; }
.sh-reason { margin-top: 12px; }

/* Project settings tab */
.set-pane { margin-bottom: 16px; }
.set-h { margin: 0; font-size: var(--fs-section); font-weight: var(--fw-semibold); color: var(--c-ink); display: flex; gap: 8px; align-items: center; }
.set-h .ico { color: var(--c-ink); width: 20px; height: 20px; }
.set-body { padding: 16px; }
/* Extras: one switch card per extra; switching it on opens its own settings */
.xt-intro { margin: 4px 0 12px; }
.xt-intro p { margin: 4px 0 0; }
.xt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.xt-card { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(20,20,28,.04); transition: border-color .15s, box-shadow .15s; }
.xt-card.on { border-color: var(--c-ink); box-shadow: var(--focus-ring); }
/* Three answers (Which units, Paid) must stay inside the card: the buttons wrap instead of pushing the page sideways. */
.xt-card .seg { flex-wrap: wrap; max-width: 100%; width: auto; }
.xt-card .mt-pair select { min-width: 0; }
.xt-head { display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer; }
.xt-head:hover { background: var(--c-select); }
.xt-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-lg); background: var(--c-tile); color: var(--c-muted); transition: background .15s, color .15s; }
.xt-ico .ico { width: 22px; height: 22px; }
.xt-card.on .xt-ico { background: var(--c-select); color: var(--c-ink); }
.xt-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.xt-title b { font-size: var(--fs-body); color: var(--c-ink); }
.xt-title small { font-size: var(--fs-hint); color: var(--c-muted); }
.xt-state { font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-faint); white-space: nowrap; }
.xt-card.on .xt-state { color: var(--c-ink); }
.xt-body { padding: 0 16px 16px; border-top: 1px solid var(--c-line); padding-top: 14px; display: grid; gap: 12px; }
.xt-body[hidden], .xt-body .field[hidden] { display: none; }
.xt-q { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); }
.xt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.xt-row[hidden] { display: none; }
.xt-explain { margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--c-page); font-size: var(--fs-table); color: var(--c-text); }
.seg { display: inline-flex; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; width: max-content; }
.seg input, .chips input, .opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-muted); cursor: pointer; /* hover: on .seg input:not(:checked) + span */ }
.seg input:checked + span { background: var(--c-ink); color: var(--c-card); }
.seg input:not(:checked) + span:hover { background: var(--c-select-line); color: var(--c-ink); }
.chips { display: inline-flex; gap: 8px; }
.chips span { display: grid; place-items: center; width: 48px; height: 44px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); font-size: 20px; font-weight: var(--fw-semibold); color: var(--c-muted); cursor: pointer; /* hover: on .chips input:not(:checked) + span */ }
.chips input:checked + span { border-color: var(--c-ink); background: var(--c-select); color: var(--c-ink); }
.chips input:not(:checked) + span:hover { background: var(--c-select-line); color: var(--c-ink); }
.pct-box { display: inline-flex; align-items: center; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--c-card); }
.pct-box input { width: 80px; border: 0; padding: 9px 10px; font: inherit; font-size: var(--fs-body); }
.pct-box span { padding: 0 12px; color: var(--c-muted); font-weight: var(--fw-semibold); }
.opt-cards { display: grid; gap: 8px; }
.opt-card span { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); cursor: pointer; /* hover: on .opt-card input:not(:checked) + span */ }
.opt-card b { font-size: var(--fs-table); color: var(--c-ink); }
.opt-card small { font-size: var(--fs-hint); color: var(--c-muted); }
.opt-card input:checked + span { border-color: var(--c-ink); background: var(--c-select); }
.opt-card input:not(:checked) + span:hover { box-shadow: var(--card-shadow); }
.seg input:focus-visible + span, .chips input:focus-visible + span, .opt-card input:focus-visible + span { outline: 2px solid var(--c-ink); outline-offset: 2px; }
.set-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 0; background: var(--c-page); }
.set-savebar .ico { width: 10px; height: 10px; color: var(--c-ink); }
@media (max-width: 860px) { .xt-grid { grid-template-columns: 1fr; } .xt-state { display: none; } }
/* View list: add box on top, then one row per view (order, name, units using it, Shown switch, Remove) */
.vw-add { display: flex; gap: 8px; max-width: 720px; margin-bottom: 14px; }
.vw-add input { flex: 1; min-width: 0; font: inherit; font-size: var(--fs-body); padding: 9px 12px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); }
.vw-list { list-style: none; margin: 0; padding: 0; max-width: 720px; border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.vw-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--c-card); }
.vw-row + .vw-row { border-top: 1px solid var(--c-line); }
.vw-row:hover { background: var(--c-page); }
.vw-row.off { background: var(--c-page); }
.vw-row.off .vw-label { color: var(--c-faint); }
.vw-remove:disabled { opacity: .3; cursor: not-allowed; background: none; }
.vw-label { flex: 1; min-width: 0; font: inherit; font-size: var(--fs-body); font-weight: var(--fw-medium); padding: 7px 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--c-ink); }
.vw-label:hover { border-color: var(--c-line-strong); }
.vw-label:focus { border-color: var(--c-ink); background: var(--c-card); outline: none; }
.vw-count { font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); background: var(--c-tile); padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; }
.vw-count.none { color: var(--c-faint); background: none; }
.vw-shown { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.vw-shown:hover .vw-shown-text { color: var(--c-ink); }
.vw-shown-text { width: 50px; font-size: var(--fs-hint); color: var(--c-muted); }
.vw-remove .ico { width: 17px; height: 17px; }
.vw-remove:not(:disabled):hover { color: var(--c-card); background: var(--c-danger); } /* row action: fills red like rowIcon d */
@media (max-width: 860px) { .vw-shown-text { display: none; } .vw-row { gap: 6px; padding: 8px; } }

@media (max-width: 860px) {
  .bp { grid-template-columns: minmax(0, 1fr); }
  .bp-side { position: static; }
  .bp-list { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .bp-bld { flex: 0 0 auto; }
  .bp-panel { display: none; }
  .bp-floor { grid-template-columns: 96px 1fr; }
  .wz { grid-template-columns: minmax(0, 1fr); }
  .wz-right { position: static; }
  .sh-wrap { max-height: calc(100vh - 260px); }
}
.bp-panel-foot { margin-top: 4px; }
.modal-body .bp-panel-foot { margin-top: 14px; }
.sh-group-label { position: sticky; left: 8px; }
.field[hidden] { display: none; }

/* Units tab: the "Units List" bar stays under the top bar while scrolling (cards, table, board); the table scrolls inside its frame with the header row and the Unit column pinned */
:root { --sticky-top: var(--topbar-h); }
@media (max-width: 860px) { :root { --sticky-top: calc(52px + var(--topbar-h)); } }
.units-head { position: sticky; top: var(--sticky-top); z-index: 8; align-items: center; margin: 12px 0; padding: 10px 0; background: var(--c-page); box-shadow: 0 1px 0 var(--c-line); }
.units-scroll { max-height: var(--wrap-h, calc(100vh - var(--sticky-top) - 110px)); overflow: auto; overscroll-behavior: contain auto; } /* up / down passes on to the page (see .tbl-wrap) */
.units-scroll thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--c-line); }
.units-scroll .u-col { position: sticky; left: 0; z-index: 1; background: var(--c-card); box-shadow: inset -1px 0 0 var(--c-line); }
.units-scroll thead th.u-col { z-index: 3; }
/* Total price stays in view at the right edge (next to the column picker), like Unit on the left */
.units-scroll .t-col { position: sticky; right: 46px; z-index: 1; background: var(--c-card); box-shadow: inset 1px 0 0 var(--c-line), -6px 0 8px -6px rgba(0,0,0,.08); }
.units-scroll thead th.t-col { z-index: 3; }
.units-scroll tbody tr:hover .t-col { background: inherit; }
.units-scroll tbody tr:hover .u-col { background: inherit; }
.units-scroll.has-sel th:first-child, .units-scroll.has-sel td:first-child { position: sticky; left: 0; z-index: 1; width: 48px; min-width: 48px; max-width: 48px; padding-right: 0; background: var(--c-card); }
.units-scroll.has-sel thead th:first-child { z-index: 3; }
.units-scroll.has-sel .u-col { left: 48px; }
.units-scroll tbody tr:hover td:first-child { background: inherit; }
@media (max-width: 860px) { .units-head { position: static; box-shadow: none; } }
/* Price breakdown (unit panels, offers)  */
.pb { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-table); margin: 12px 0; }
.pb td:first-child { padding-inline-end: 8px; overflow-wrap: anywhere; }
.pb caption { text-align: start; font-weight: var(--fw-semibold); color: var(--c-ink); padding-bottom: 6px; }
.pb td, .pb th { padding: 6px 0; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.pb td:last-child { width: 42%; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pb th[colspan] { width: auto; }
.pb th { text-align: start; font-size: var(--fs-hint); color: var(--c-muted); font-weight: var(--fw-semibold); padding-top: 10px; }
.pb small { display: block; color: var(--c-muted); font-size: var(--fs-hint); }
.pb-total td { font-weight: var(--fw-semibold); color: var(--c-ink); }
.pb-sub td { padding: 3px 0; border-bottom: 0; font-size: var(--fs-hint); color: var(--c-muted); }
.x-sep { display: block; font-size: var(--fs-hint); color: var(--c-faint); font-weight: 400; }
.pb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 1px; }
.pb-chip { display: inline-block; margin-inline-start: 0; padding: 1px 8px; border-radius: var(--r-pill); background: var(--c-select); color: var(--c-muted); font-size: var(--fs-hint); font-weight: var(--fw-medium); }
.field[hidden] { display: none; }

.xt-foot { display: flex; justify-content: flex-end; }
.xt-others { list-style: none; margin: 0; padding: 0 16px 14px; display: grid; gap: 8px; }
.xt-others li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-top: 8px; border-top: 1px solid var(--c-line); }
.xt-acts { margin-inline-start: auto; display: flex; gap: 10px; }
.xt-acts .danger-text { color: var(--c-danger); }

/* Units | Projects switch (top of both "Units & projects" screens) and the Units page filters */
.entry-switch { display: inline-flex; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--c-card); }
.entry-title { line-height: 1; }
.entry-title .entry-switch { flex-direction: row; gap: 0; }
.entry-switch a { padding: 7px 20px; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--c-muted); text-decoration: none; }
.entry-switch a:hover { color: var(--c-ink); }
.entry-switch a.on { background: var(--c-ink); color: var(--c-card); }
.entry-switch a:focus-visible { outline: 2px solid var(--c-ink); outline-offset: -2px; }
.units-filter-row { margin-top: 12px; }
.inv-filter-foot .link[hidden] { display: none; }
.units-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Add unit screen (addUnit.js): numbered sections on the left, a live card of the unit on the right */
dialog.modal.au { width: min(1080px, 96vw); }
dialog.modal.au:has(.au-grid) { height: min(860px, 94vh); }
.au-head { align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line); }
.au-title { flex: 1; min-width: 0; }
.au-title p { margin: 4px 0 0; }
.au-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--c-select-line); border-radius: var(--r-md); background: var(--c-select); color: var(--c-ink); max-width: 320px; }
.au-chip > span { display: grid; min-width: 0; line-height: 1.2; }
.au-chip small { font-size: var(--fs-hint); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.au-chip b { font-size: var(--fs-body); color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-chip .ico { width: 18px; height: 18px; flex: none; }
.au-chip.locked > .ico:last-child { width: 15px; height: 15px; color: var(--c-muted); }
.au-body { padding: 0; background: var(--c-page); }
.au-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding: 20px 24px; align-items: start; }
dialog .au-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0; }
.au-sec { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 16px 18px 18px; box-shadow: var(--card-shadow); }
.au-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-ink); }
.au-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c-select); color: var(--c-ink); font-size: var(--fs-hint); font-weight: var(--fw-semibold); }
.au-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.au-fields .full { grid-column: 1 / -1; }
.au-fields [hidden] { display: none; }
.au-fields select:disabled { background: var(--c-neutral-soft); color: var(--c-faint); }
.au-no-wrap { position: relative; display: block; }
.field.au-no input { font-size: var(--fs-title); font-weight: var(--fw-semibold); padding: 12px 170px 12px 14px; letter-spacing: .02em; }
.field.au-no input:focus { outline: none; border-color: var(--c-ink); box-shadow: var(--focus-ring); }
.field.au-no.bad input { border-color: var(--c-danger); box-shadow: 0 0 0 3px var(--c-danger-soft); }
.au-no-state { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-hint); font-weight: var(--fw-semibold); padding: 4px 10px; border-radius: 20px; }
.au-no-state:empty { display: none; }
.au-no-state.free { background: var(--c-success-soft); color: var(--c-success); }
.au-no-state.taken { background: var(--c-danger-soft); color: var(--c-danger); }
.au-no-state .ico { width: 13px; height: 13px; }
.au-seg { max-width: 100%; flex-wrap: wrap; }
.au-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.au-pills label, .au-toggle { position: relative; }
/* Hidden radio / checkbox sits inside its own pill: a full-width one made the Add unit window jump when a pill was clicked. */
.au-pills input, .au-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.au-pills span { display: block; padding: 8px 14px; border: 1px solid var(--c-line-strong); border-radius: 20px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-muted); cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.au-pills span:hover { border-color: var(--c-select-line); color: var(--c-ink); }
/* picked = the picked look of the design system (#263: soft blue, blue words, 2px blue edge; Sami 2026-11-17: the grey one was too faint to see) */
.au-pills input:checked + span, .au-pills input:checked + span:hover { border-color: transparent; background: var(--c-accent-soft); color: var(--c-accent-text); box-shadow: inset 0 0 0 2px var(--c-accent); }
.au-pills input:focus-visible + span { outline: 2px solid var(--c-ink); outline-offset: 2px; }
.au-suffix { display: flex; align-items: center; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); overflow: hidden; }
.au-suffix:focus-within { border-color: var(--c-ink); box-shadow: var(--focus-ring); }
.field .au-suffix input { border: 0; border-radius: 0; flex: 1; min-width: 0; outline: none; }
.au-suffix i { font-style: normal; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-muted); padding: 0 12px; }
.field .au-money input { font-size: var(--fs-section); font-weight: var(--fw-semibold); }
.au-step { display: flex; align-items: stretch; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--c-card); }
.au-step:focus-within { border-color: var(--c-ink); box-shadow: var(--focus-ring); }
.au-step button { flex: none; width: 40px; border: 0; background: var(--c-neutral-soft); font: inherit; font-size: var(--fs-section); color: var(--c-ink); cursor: pointer; }
.au-step button:hover { background: var(--c-select); color: var(--c-ink); }
.field .au-step input { border: 0; border-radius: 0; text-align: center; font-weight: var(--fw-semibold); outline: none; }
.au-note { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--c-page); font-size: var(--fs-table); color: var(--c-muted); }
.au-note .ico { width: 16px; height: 16px; color: var(--c-ink); flex: none; }
.au-toggle-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color .12s, background .12s; }
.au-toggle-box:hover { border-color: var(--c-ink); }
.pf-locked .au-toggle-box:hover { border-color: var(--c-line-strong); }
.au-toggle-box > .ico { width: 22px; height: 22px; color: var(--c-muted); flex: none; }
.au-toggle-box > span { display: grid; flex: 1; min-width: 0; }
.au-toggle-box b { font-size: var(--fs-body); color: var(--c-ink); }
.au-toggle-box small { font-size: var(--fs-hint); color: var(--c-muted); font-weight: 400; }
.au-toggle-box > .au-tick { display: grid; flex: none; } /* beats .au-toggle-box > span above: the tick stays a 22px circle */
.au-tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--c-line-strong); color: transparent; flex: none; }
.au-tick .ico { width: 13px; height: 13px; }
.au-toggle input:checked + .au-toggle-box { border-color: var(--c-ink); background: var(--c-select); }
.au-toggle input:checked + .au-toggle-box > .ico { color: var(--c-ink); }
/* New / Edit project (openProjectForm in pages/projects.js): the Add unit sections, fixed size, content scrolls */
dialog.modal.pf { width: min(720px, 96vw); height: min(780px, 94vh); }
dialog.modal.pf .modal-body { background: var(--c-page); padding: 16px 20px; }
.pf-form { gap: 14px; }
.pf-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pf-locked .au-toggle-box { cursor: default; }
.pf-locked .xt-state .ico { width: 16px; height: 16px; color: var(--c-muted); }
.pf-err { font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-danger); }
.pf-err[hidden] { display: none; }
.field.bad > input { border-color: var(--c-danger); box-shadow: 0 0 0 3px var(--c-danger-soft); }
.field.bad .pf-cats { outline: 2px solid var(--c-danger); outline-offset: 4px; border-radius: var(--r-md); }
@media (max-width: 600px) { .pf-cats { grid-template-columns: 1fr; } }
.au-toggle input:checked + .au-toggle-box .au-tick { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-card); }
.au-toggle input:focus-visible + .au-toggle-box { outline: 2px solid var(--c-ink); outline-offset: 2px; }
/* the live card */
.au-card { position: sticky; top: 0; display: grid; gap: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-select-line); box-shadow: 0 10px 30px rgba(16, 24, 40,.12); }
.au-card.pop { animation: au-pop .45s ease; }
@keyframes au-pop { 40% { transform: scale(1.02); box-shadow: 0 0 0 6px var(--c-success-soft); } }
.au-card-top { display: flex; justify-content: space-between; align-items: center; }
.au-card-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-lg); background: var(--c-select); color: var(--c-ink); }
.au-card-no { font-size: var(--fs-kpi); font-weight: var(--fw-semibold); color: var(--c-ink); line-height: 1.1; word-break: break-word; }
.au-card-no.empty { color: var(--c-line-strong); }
.au-card-type { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-text); margin-top: -6px; }
.au-card-proj { font-size: var(--fs-hint); color: var(--c-muted); margin-top: -8px; }
.au-card-where, .au-card-extras { display: flex; flex-wrap: wrap; gap: 6px; }
.au-card-where span, .au-card-extras span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 20px; background: var(--c-neutral-soft); font-size: var(--fs-hint); font-weight: var(--fw-medium); color: var(--c-text); }
.au-card-where .ico { width: 12px; height: 12px; color: var(--c-muted); }
.au-card-extras span { background: var(--c-select); color: var(--c-text); }
.au-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.au-facts div { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-md); background: var(--c-page); }
.au-facts b { font-size: var(--fs-body); color: var(--c-ink); }
.au-facts i { font-style: normal; font-size: var(--fs-hint); color: var(--c-muted); font-weight: var(--fw-medium); }
.au-facts small { font-size: var(--fs-hint); color: var(--c-muted); }
/* price: the unit, each extra, then the total on a dark band */
.au-price { display: grid; border-radius: var(--r-lg); border: 1px solid var(--c-line); overflow: hidden; }
.au-pl { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--c-line); }
.au-pl > span { display: grid; gap: 1px; min-width: 0; }
.au-pl b { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); }
.au-pl small { font-size: var(--fs-hint); color: var(--c-muted); }
.au-pl em { font-style: normal; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.au-pl em.none { color: var(--c-faint); font-weight: var(--fw-medium); font-size: var(--fs-hint); }
.au-pl.add b { color: var(--c-text); }
.au-pl.add em { color: var(--c-text); }
.au-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; background: var(--c-btn); color: var(--c-card); }
.au-total span { font-size: var(--fs-hint); opacity: .8; }
.au-total b { font-size: var(--fs-title); font-weight: var(--fw-semibold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.au-total b i { font-style: normal; font-size: var(--fs-hint); opacity: .75; }
.au-total b.empty { font-size: var(--fs-section); opacity: .6; }
/* the two parts of the total when an extra is paid separately */
.au-split { display: grid; grid-template-columns: 1fr 1fr; background: var(--c-btn); color: var(--c-card); border-top: 1px solid rgba(255,255,255,.12); }
.au-split span { display: grid; gap: 2px; padding: 8px 14px 10px; font-size: var(--fs-hint); opacity: .85; }
.au-split span + span { border-inline-start: 1px solid rgba(255,255,255,.12); }
.au-split b { font-size: var(--fs-body); font-weight: var(--fw-semibold); opacity: 1; font-variant-numeric: tabular-nums; }
.au-warn { margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--c-warning-soft); color: var(--c-warning); font-size: var(--fs-hint); }
.au-ready { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--c-line); display: grid; gap: 6px; }
.au-ready li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-table); color: var(--c-faint); }
.au-ready li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--c-line-strong); flex: none; }
.au-ready li.ok { color: var(--c-ink); }
.au-ready li.ok::before { display: none; }
.au-ready li .ico { width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: var(--c-success); color: var(--c-card); }
.au-foot { align-items: center; }
.au-foot[hidden] { display: none; }
.au-added { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-success); }
.au-added .ico { width: 15px; height: 15px; }
.au-keys { margin-inline-end: auto; }
/* project picker (opened from the Units page) */
.au-pick { padding: 24px; }
.au-pick-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.au-pick-head b { font-size: var(--fs-section); color: var(--c-ink); }
/* the project search: the shared list search box (.fx-search), beside the question, not the tall dialog label (Sami 2026-11-16) */
.au-pick-head .fx-search { flex: 0 1 360px; font-weight: var(--fw-regular); }
.au-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.au-pick-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-card); font: inherit; text-align: start; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.au-pick-card:hover, .au-pick-card:focus-visible { border-color: var(--c-ink); box-shadow: var(--focus-ring); transform: translateY(-1px); outline: none; }
.au-pick-card[hidden] { display: none; }
.au-pick-card b { font-size: var(--fs-body); color: var(--c-ink); }
.au-pick-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-lg); background: var(--c-select); color: var(--c-ink); flex: none; }
@media (max-width: 860px) {
  dialog.modal.au, dialog.modal.au:has(.au-grid) { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; border-radius: 0; }
  .au-head { flex-wrap: wrap; padding: 14px 16px; gap: 10px; }
  .au-title { flex-basis: calc(100% - 48px); order: 1; }
  .au-head [data-x] { order: 2; }
  .au-proj { order: 3; flex-basis: 100%; }
  .au-chip { max-width: 100%; }
  .au-title p, .au-keys { display: none; }
  .au-grid { grid-template-columns: 1fr; padding: 12px 16px; gap: 12px; }
  .au-card { order: -1; position: sticky; top: 0; z-index: 2; grid-template-columns: 1fr auto; padding: 12px 14px; gap: 4px 12px; }
  .au-card-top, .au-card-proj, .au-card-where, .au-facts, .au-card-extras, .au-ready, .au-warn { display: none; }
  .au-card-no { font-size: var(--fs-title); }
  .au-card-type { grid-column: 1; margin: 0; font-size: var(--fs-table); }
  .au-price { grid-column: 2; grid-row: 1 / span 2; align-self: center; border: 0; }
  .au-pl { display: none; }
  .au-total { display: grid; gap: 0; padding: 8px 12px; text-align: end; border-radius: var(--r-md); }
  .au-total span { font-size: var(--fs-hint); }
  .au-total b { font-size: var(--fs-section); }
  .au-total b.empty { font-size: var(--fs-body); }
  .au-split { display: none; }
  .au-sec { padding: 14px; }
  .au-foot { padding: 10px 16px; }
  .au-foot .btn { flex: 1; justify-content: center; }
  .au-foot [data-x] { display: none; }
  .au-added { flex-basis: 100%; }
  .au-added:empty { display: none; }
  .field.au-no input { padding-inline-end: 14px; }
  .au-no-state { position: static; transform: none; margin-top: 6px; width: max-content; }
  .au-pick { padding: 16px; }
  .au-pick-head .fx-search { flex-basis: 100%; }
}

/* Under Review band: a warning, so it is seen (Sami 2026-11-03) */
.rv-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; border: 1px solid var(--amber-line); background: var(--amber-soft); }
.rv-banner-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--amber); color: #fff; font-size: 20px; font-weight: 700; }
.rv-banner-text { flex: 1 1 280px; }
.rv-banner-text b { display: block; font-size: 15.5px; color: var(--amber); }
.rv-banner-text span { font-size: 13px; color: var(--ink); }
.rv-banner-actions { display: flex; gap: 8px; margin-left: auto; }
/* Wave 2d: floor plan editor (a grid; every box is placed with --c / --r / --cs / --rs) */
.lay-head h1 { margin: 6px 0 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.lay-head p { margin: 4px 0 0; }
.lay-floors { margin-top: 12px; max-width: 100%; }
.lay-bar { top: 0; }
.lay-note { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--amber-line); background: var(--amber-soft); color: var(--amber); border-radius: var(--radius); font-size: 14px; }
.lay-note[hidden] { display: none; }
.lay-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.lay-side { padding: 14px; display: grid; gap: 10px; }
.lay-side h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.lay-units { display: flex; flex-wrap: wrap; gap: 6px; max-height: 320px; overflow: auto; }
.lay-unit { display: grid; gap: 1px; text-align: left; font: inherit; font-size: 12.5px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--white); color: var(--ink); cursor: pointer; }
.lay-unit small { color: var(--muted); font-size: 11px; }
.lay-unit.on { border-color: var(--purple); background: var(--purple-soft); }
.lay-unit:not(.on):hover { border-color: var(--c-line-strong); box-shadow: var(--card-shadow); }
.lay-unit:focus-visible, .lay-cell:focus-visible, .lay-floors button:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
.lay-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 10px; font-size: 13.5px; }
.lay-num { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.lay-num input { width: 70px; font: inherit; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
.lay-sel { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lay-scroll { overflow: auto; max-height: calc(100vh - 300px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.lay-grid { --col-min: 54px; --row-h: 24px; position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(var(--col-min), 1fr)); grid-auto-rows: var(--row-h); min-width: calc(var(--cols) * var(--col-min));
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--cols)) var(--row-h); touch-action: pan-x pan-y; }
.lay-grid.armed { cursor: crosshair; touch-action: none; }
.lay-cell, .lay-ghost { grid-column: var(--c) / span var(--cs); grid-row: var(--r) / span var(--rs); }
.lay-cell { position: relative; z-index: 1; box-sizing: border-box; margin: 1px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); font-size: 11.5px; line-height: 1.2; text-align: center; cursor: grab; touch-action: none; user-select: none; }
.lay-cell b { font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lay-cell small { color: inherit; opacity: .8; font-size: 10.5px; }
.lay-cell.unit { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.lay-cell.unit.off { background: var(--gray-soft); border-color: var(--line); color: var(--gray); }
.lay-cell.unit.ust-on_hold { background: var(--us-on_hold-soft); border-color: var(--us-on_hold-line); color: var(--us-on_hold-ink); }
.lay-cell.unit.ust-pending_reservation { background: var(--us-pending_reservation-soft); border-color: var(--us-pending_reservation-line); color: var(--us-pending_reservation-ink); }
.lay-cell.unit.ust-reserved { background: var(--us-reserved-soft); border-color: var(--us-reserved-line); color: var(--us-reserved-ink); }
.lay-cell.unit.ust-sold { background: var(--us-sold-soft); border-color: var(--us-sold-line); color: var(--us-sold-ink); }
.lay-cell.unit.ust-blocked { background: var(--us-blocked-soft); border-color: var(--us-blocked-line); color: var(--us-blocked-ink); }
.lay-cell.fix { background: var(--gray-soft); border-style: dashed; color: var(--muted); font-style: italic; }
.lay-cell.sel { z-index: 2; border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple); overflow: visible; }
.lay-handle { position: absolute; right: -5px; bottom: -5px; width: 12px; height: 12px; border-radius: 3px; background: var(--purple); border: 2px solid var(--white); cursor: nwse-resize; }
.lay-ghost { z-index: 3; margin: 1px; border: 2px dashed var(--purple); background: var(--purple-soft); opacity: .7; border-radius: 6px; pointer-events: none; }
.lay-ghost.bad { border-color: var(--red); background: var(--red-soft); }
.lay-ghost[hidden] { display: none; }
@media (max-width: 860px) {
  .lay-body { grid-template-columns: minmax(0, 1fr); }
  .lay-units { max-height: 180px; }
  .lay-scroll { max-height: 70vh; }
}

/* Wave 2d: brochure floor image (shapes are drawn on top of the picture, points in 0-1 of its size) */
.lay-mode { margin-top: 12px; max-width: 100%; }
.bro-empty { margin-top: 12px; }
.bro-method, .bro-zoom { display: inline-flex; gap: 6px; align-items: center; }
.bro-method .btn.on { border-color: var(--purple); background: var(--purple-soft); color: var(--purple-dark); }
.bro-box { overflow: auto; max-height: calc(100vh - 340px); min-height: 240px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.bro-stage { position: relative; width: calc(var(--zoom) * 100%); aspect-ratio: var(--ar); user-select: none; }
.bro-stage.armed { cursor: crosshair; touch-action: none; }
.bro-img { display: block; width: 100%; height: 100%; pointer-events: none; }
.bro-layer, .bro-svg, .bro-over { position: absolute; inset: 0; width: 100%; height: 100%; }
.bro-over { pointer-events: none; }
.bro-svg { overflow: visible; }
.bro-shape { vector-effect: non-scaling-stroke; stroke-width: 2; fill-opacity: .4; cursor: grab; touch-action: none; fill: var(--green); stroke: var(--green); }
.bro-shape.off, .bro-shape.ust-blocked { fill: var(--us-blocked); stroke: var(--us-blocked); }
.bro-shape.ust-on_hold { fill: var(--us-on_hold); stroke: var(--us-on_hold); }
.bro-shape.ust-pending_reservation { fill: var(--us-pending_reservation); stroke: var(--us-pending_reservation); }
.bro-shape.ust-reserved { fill: var(--us-reserved); stroke: var(--us-reserved); }
.bro-shape.ust-sold { fill: var(--us-sold); stroke: var(--us-sold); }
.bro-shape.sel { stroke: var(--purple); stroke-width: 3; fill-opacity: .55; }
.bro-shape:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
.bro-ghost { vector-effect: non-scaling-stroke; fill: var(--purple-soft); fill-opacity: .6; stroke: var(--purple); stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.bro-label { position: absolute; transform: translate(-50%, -50%); padding: 1px 6px; border-radius: 6px; background: var(--white); color: var(--ink); font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; opacity: .92; }
.bro-h, .bro-dot { position: absolute; transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 3px; background: var(--purple); border: 2px solid var(--white); box-sizing: border-box; }
.bro-h { pointer-events: auto; cursor: pointer; touch-action: none; }
.bro-h:hover { filter: brightness(.9); }
.bro-dot { border-radius: 50%; }
.bro-pin { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; background: var(--c-card); border: 3px solid var(--us-available); box-sizing: border-box; pointer-events: auto; cursor: grab; touch-action: none; }
.bro-pin.sel { border-color: var(--c-btn); }
@media (max-width: 860px) {
  .bro-box { max-height: 70vh; }
}
.bro-stage:focus { outline: none; }
.unit-offer { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); font-size: var(--fs-hint); padding: var(--sp-1) 0; }


/* Unit page + Edit unit (Sami 2026-11-11; a page since 2026-11-23): the unit card made big, the price block, change marks, locks, Extras as buttons. */
/* --- pop-up: the unit card, made big (same .uc classes and icons as the card on the list) --- */
.uv-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 16px; align-items: start; }
.uv-left { display: grid; gap: 12px; min-width: 0; }
.uv-hero .uc { cursor: default; } .uv-hero .uc:hover { transform: none; box-shadow: 0 1px 2px rgba(20,20,28,.04); border-color: var(--c-card-line); }
.uv-hero .uc-id h3 { font-size: 30px; }
.uv-where { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 18px 0; font-size: var(--fs-hint); color: var(--c-muted); }
.uv-where span { display: inline-flex; align-items: center; gap: 5px; } .uv-where .ico { width: 14px; height: 14px; }
.uv-where a { color: var(--c-accent-text); text-decoration: none; } .uv-where a:hover { text-decoration: underline; }
.uv-hero .uc-perks { padding-bottom: 16px; }
/* the price: the Add unit price lines (au-price), the Total price filled blue, the maintenance apart under it */
.uv-price { display: grid; gap: 10px; align-content: start; }
.uv-price .au-total { padding: 14px 16px; }
.uv-maint { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--c-tile); border-top: 4px solid var(--c-card); } /* inside the price card, under the Total price: a thin white gap + a grey row = part of the money, not of the total */
.uv-maint > span { display: grid; gap: 1px; } .uv-maint b { font-size: var(--fs-table); color: var(--c-ink); font-weight: var(--fw-semibold); }
.uv-maint small { font-size: var(--fs-hint); color: var(--c-muted); }
.uv-maint em { font-style: normal; font-weight: var(--fw-semibold); color: var(--c-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* an add-on area (garden, outdoor) sits right after the unit area, lighter and dashed: outside the unit, never mixed into it */
.uc-facts.has-addon { grid-template-columns: minmax(0, 1fr) max-content; grid-auto-flow: row; column-gap: 10px; }
.uc-facts.has-addon li.area-li { padding-inline-end: 14px; }
.uc-facts li.area-li { flex-wrap: wrap; row-gap: 6px; white-space: normal; }
.uv-addon { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; padding: 2px 9px; border: 1px dashed var(--c-line-strong); border-radius: var(--r-pill); background: var(--c-card); font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-text); white-space: nowrap; }
.uc-facts .uv-addon .ico { width: 13px; height: 13px; }
.uv-addon small { font-weight: 400; color: var(--c-muted); }
/* the narrow card beside the form: the unit area + its add-ons take the first line, the floor the second */
.au-card .uc-facts.has-addon { grid-template-columns: 1fr; row-gap: 10px; }
.au-card .uc-facts.has-addon li.area-li { padding-inline-end: 0; }
.au-card .uc-facts.has-addon li:nth-child(2) { border-inline-start: 0; justify-content: flex-start; }
.uv-now { display: flex; align-items: center; gap: 12px; }
.uv-now > div { flex: 1; min-width: 0; }
.uv-now .holder-box, .uv-now .block-box, .uv-now .review-box { margin: 0; }
.uv-secs { display: grid; gap: 12px; margin-top: 14px; }
.uv-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: var(--fs-table); } .uv-row + .uv-row { border-top: 1px solid var(--c-line); }
.uv-offer + .uv-offer { border-top: 1px solid var(--c-line); } .uv-det { padding: 2px 2px 10px; font-size: var(--fs-table); } /* a reserved / sold offer's details under its row (T-113) */
.uv-row .grow { flex: 1; min-width: 0; }
.uv-row a { color: var(--c-accent-text); font-weight: var(--fw-semibold); text-decoration: none; }
@media (max-width: 860px) { .uv-hero { grid-template-columns: 1fr; } }
/* --- NEW (Edit unit only): change marks. Blue = changed, the same blue as a picked filter / ticked row. --- */
.field.chg > input, .field.chg > select, .field.chg > textarea, .field.chg .au-suffix, .field.chg .au-step, .field.chg .au-seg, .field.chg .au-pills span { border-color: var(--c-btn); }
.field.chg > input, .field.chg > select, .field.chg > textarea, .field.chg .au-suffix, .field.chg .au-step { background: var(--c-accent-soft); }
.au-toggle.chg input + .au-toggle-box { border-color: var(--c-btn); background: var(--c-accent-soft); }
.was { display: none; align-items: center; gap: 8px; font-size: var(--fs-hint); font-weight: 400; color: var(--c-accent-text); }
.chg > .was, .chg + .was { display: flex; }
.was s { color: var(--c-muted); }
.au-sec h3 .chg-n { margin-left: auto; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-btn); background: var(--c-accent-soft); border: 1px solid var(--c-accent-line); border-radius: var(--r-pill); padding: 2px 9px; }
.au-sec.has .au-num { background: var(--c-btn); color: #fff; }
/* Extras = buttons (Sami 2026-11-11: "they must say I am a button"): raised card, icon tile, the system switch (green when on, like
   Settings → Extras) with the word Added / Tap to add; hover lifts it and turns the edge blue, a press sinks it. */
.xt-btn .au-toggle-box { gap: 14px; padding: 12px 14px; background: var(--c-card); border-color: var(--c-line-strong); box-shadow: 0 1px 0 var(--c-line-strong), 0 2px 6px rgba(20,20,28,.06); transition: border-color .12s, box-shadow .12s, transform .12s, background .12s; }
.xt-btn:hover .au-toggle-box { border-color: var(--c-btn); box-shadow: 0 1px 0 var(--c-btn), 0 8px 18px rgba(20,20,28,.10); transform: translateY(-1px); }
.xt-btn:active .au-toggle-box { transform: translateY(1px); box-shadow: 0 0 0 var(--c-line-strong); }
.xt-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--c-neutral-soft); color: var(--c-muted); transition: background .12s, color .12s; }
.au-toggle-box > .xt-ic { display: grid; flex: none; } .xt-ic .ico { width: 20px; height: 20px; }
.au-toggle-box > .xt-state { display: flex; flex: none; align-items: center; gap: 10px; }
.xt-state em { font-style: normal; font-size: var(--fs-hint); font-weight: var(--fw-semibold); white-space: nowrap; }
.xt-off { color: var(--c-accent-text); } .xt-on { display: none; color: var(--c-success); }
.xt-state .switch span { pointer-events: none; }
.xt-btn input:checked + .au-toggle-box { border-color: var(--c-success-line); background: var(--c-success-soft); box-shadow: 0 1px 0 var(--c-success-line), 0 2px 6px rgba(20,20,28,.06); }
.xt-btn input:checked + .au-toggle-box .xt-ic { background: var(--c-success); color: #fff; }
.xt-btn input:checked + .au-toggle-box .xt-on { display: inline; } .xt-btn input:checked + .au-toggle-box .xt-off { display: none; }
.xt-btn input:checked + .au-toggle-box .switch span { background: var(--c-success); }
.xt-btn input:checked + .au-toggle-box .switch span::before { transform: translateX(14px); }
.xt-btn input:focus-visible + .au-toggle-box { outline: none; box-shadow: var(--focus-ring); }
.xt-btn.chg input + .au-toggle-box { border-color: var(--c-btn); }
/* locked (reserved): no box to type in, no pill to press. A flat hatched panel with a lock, the value in grey, "not allowed" pointer. */
.ro-val { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--c-line); border-radius: var(--r-md); color: var(--c-muted); cursor: not-allowed; user-select: none;
  background: repeating-linear-gradient(-45deg, var(--c-tile) 0 6px, var(--c-card) 6px 12px); }
.ro-val > .ico { width: 15px; height: 15px; color: var(--c-faint); flex: none; }
.ro-val b { font-weight: var(--fw-semibold); color: var(--c-text); }
.ro-toggle > span { display: grid; flex: 1; } .ro-toggle small { font-size: var(--fs-hint); color: var(--c-muted); } .ro-toggle > .ico:first-child { width: 20px; height: 20px; }
.au-sec.is-locked { background: var(--c-tile); box-shadow: none; }
.au-sec.is-locked .au-num { background: var(--c-card); border: 1px solid var(--c-line); color: var(--c-faint); } .au-sec.is-locked .au-num .ico { width: 12px; height: 12px; }
.lock-n { margin-left: auto; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--us-reserved-ink); background: var(--us-reserved-soft); border: 1px solid var(--us-reserved-line); border-radius: var(--r-pill); padding: 2px 9px; }
.lock-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--us-reserved-soft); border: 1px solid var(--us-reserved-line); color: var(--us-reserved-ink); font-size: var(--fs-table); }
.lock-note > .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; } .lock-note b { color: var(--c-ink); } .lock-note a { color: var(--c-accent-text); }
.lock-note small { display: block; margin-top: 4px; color: var(--us-reserved-ink); font-size: var(--fs-hint); }
.chg-btn b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-right: 2px; border-radius: var(--r-pill); background: var(--c-btn); color: #fff; font-size: var(--fs-hint); }
.chg-wrap { position: relative; }
.chg-pop { position: absolute; bottom: calc(100% + 8px); left: 0; width: 340px; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px; z-index: 5; }
.chg-pop div { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); font-size: var(--fs-table); }
.chg-pop div:hover { background: var(--c-select); }
.chg-pop span { flex: 1; } .chg-pop small { display: block; color: var(--c-muted); } .chg-pop s { color: var(--c-faint); }
.au-pl.old em { color: var(--c-faint); text-decoration: line-through; }
.au-total { flex-wrap: wrap; } .au-total .delta { flex-basis: 100%; text-align: end; font-size: var(--fs-hint); font-weight: var(--fw-semibold); opacity: .9; }
.uc mark { background: var(--c-accent-soft); color: inherit; border-radius: 4px; box-shadow: 0 0 0 2px var(--c-accent-soft); }
.modal-foot .grow { flex: 1; }
.uv-hint { display: flex; align-items: center; gap: 6px; }
.uv-empty { margin: 0; }
.uv-up { margin-top: 8px; display: inline-flex; }
.au-why-other { margin-top: 8px; }
.au-foot .grow { flex: 1; }
.unit-page { max-width: 1240px; } /* the unit page (#/units/<id>, Sami 2026-11-23) */


/* Project form: picks from Inventory Settings with their "Missing from the list?" button, phase rows and view ticks (DECISIONS #212) */
.pf-pick { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); min-width: 0; }
.pf-pick > .field { width: 100%; }
.pf-phases { display: flex; flex-direction: column; gap: var(--sp-3); }
.pf-phase { border: 1px solid var(--c-card-line); border-radius: var(--r-lg); background: var(--c-tile); overflow: hidden; }
.pf-phase-head { display: flex; align-items: center; gap: var(--sp-2); padding: 10px 14px; border-bottom: 1px solid var(--c-line); background: var(--c-card); }
.pf-phase-head b { flex: 1; min-width: 0; font-size: var(--fs-body); color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-phase-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-3); padding: 14px; }
.pf-views { margin-bottom: var(--sp-2); }
@media (max-width: 600px) { .pf-phase-body { grid-template-columns: minmax(0, 1fr); } }

/* A phase's maintenance inside the phase form (DECISIONS #214) */
.mt-box { display: flex; flex-direction: column; gap: var(--sp-2); grid-column: 1 / -1; }
.mt-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.mt-fields[hidden], .mt-fields [hidden] { display: none; }
/* A single switch inside a form: a small button-sized tile, not a full row (toggleTile compact) */
.mt-box { align-items: flex-start; }
.xt-btn.xt-compact { display: inline-block; width: auto; max-width: 100%; }
.xt-compact .au-toggle-box { gap: 10px; padding: 6px 10px 6px 6px; }
.xt-compact .xt-ic { width: 30px; height: 30px; }
.xt-compact .xt-ic .ico { width: 16px; height: 16px; }
/* A yes / no in a form (formDialog, New user, Reopen phase) is this tile, never a bare tick box (Sami 2026-11-18): full = the whole form row; pick-warn = an amber hint */
.au-toggle.full { grid-column: 1 / -1; }
.pick-warn .au-toggle-box small { color: var(--c-warning); }
@media (max-width: 600px) { .xt-btn .au-toggle-box .xt-state em.xt-on, .xt-btn .au-toggle-box .xt-state em.xt-off { display: none; } } /* phone: the switch alone says on / off, the words get the room */
.mt-fields { align-self: stretch; }
/* Paid + by how many months: one answer in one box */
.mt-paid { grid-column: 1 / -1; }
.mt-pair { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.mt-pair select { width: auto; min-width: 150px; }
.mt-by { display: inline-flex; align-items: center; gap: var(--sp-2); }
.mt-by[hidden] { display: none; }
.mt-by i { font-style: normal; color: var(--c-muted); font-size: var(--fs-table); }
.mt-warn { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: var(--r-md); background: var(--c-warning-soft); border: 1px solid var(--c-warning-line); color: var(--c-warning); font-size: var(--fs-hint); }
/* Import all floors (layoutImportAll.js) */
.lia { display: grid; gap: var(--sp-4); }
.lia .au-fields { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.lia-sum { margin: 0 0 var(--sp-3); font-size: var(--fs-body); color: var(--c-text); }
.lia-tbl { max-height: 360px; }
.lia-tbl small { display: block; margin-top: var(--sp-1); font-size: var(--fs-hint); }
.lia-fail { margin: 0; padding-inline-start: var(--sp-5); color: var(--c-danger); font-size: var(--fs-table); }

/* ---- Actions › Change › Status, Price per m² (T-138, DECISIONS #428): fixed-size pop-up, before → after per unit ---- */
dialog.modal.ef-pop { width: min(640px, 96vw); height: min(640px, 92vh); }
dialog.modal.ef-pop .modal-body { display: flex; flex-direction: column; gap: var(--sp-4); overflow-y: auto; }
dialog.modal.ef-pop .modal-foot .btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ef-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); }
.ef-grid .full { grid-column: 1 / -1; }
.ef-picks { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ef-pick { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink); font-size: var(--fs-table); font-weight: var(--fw-medium); cursor: pointer; }
.ef-pick:hover { background: var(--c-tile); }
.ef-pick[aria-pressed="true"] { background: var(--c-select); border: 2px solid var(--c-btn); color: var(--c-btn); font-weight: var(--fw-semibold); }
.ef-pick:focus-visible { box-shadow: var(--focus-ring); }
.ef-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ef-dot-success { background: var(--c-success); }
.ef-dot-warning { background: var(--c-warning); }
.ef-dot-danger { background: var(--c-danger); }
.ef-sum { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-table); color: var(--c-muted); }
.ef-sum b { color: var(--c-ink); font-weight: var(--fw-semibold); }
.ef-list { border: 1px solid var(--c-line); border-radius: var(--r-md); }
.ef-list table.tbl th, .ef-list table.tbl td { padding: 9px 12px; font-size: var(--fs-table); white-space: normal; }
.ef-list tr.skip td { color: var(--c-faint); }
.ef-old { color: var(--c-muted); text-decoration: line-through; }
.ef-arrow { color: var(--c-faint); padding: 0 4px; }
.ef-new { color: var(--c-ink); font-weight: var(--fw-semibold); }
.ef-why { color: var(--c-warning); font-size: var(--fs-hint); }
/* Two parts (Sami 2026-11-20): "Will change" on top, "Stay as they are" under it, quieter. */
.ef-part { display: flex; flex-direction: column; gap: var(--sp-2); }
.ef-part + .ef-part { margin-top: var(--sp-4); } /* + the body gap = 32px between the two parts */
.ef-part-head { margin: 0; display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); }
.ef-part-head span { min-width: 22px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--c-tile); color: var(--c-muted); font-size: var(--fs-hint); text-align: center; }
.ef-go .ef-part-head span { background: var(--c-success-soft); color: var(--c-success); }
.ef-stay .ef-part-head { color: var(--c-muted); }
.ef-stay .ef-list { background: var(--c-tile); }
.ef-stay .ef-list table.tbl { background: transparent; }
.ef-empty { color: var(--c-faint); font-size: var(--fs-table); padding: var(--sp-5); text-align: center; }
.bulk-group { padding: 8px 12px 4px; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-faint); letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 560px) { .ef-grid { grid-template-columns: 1fr; } .ef-list table.tbl td { display: block; border-bottom: 0; padding-bottom: 2px; } .ef-list table.tbl td + td { padding: 2px 12px 9px; border-bottom: 1px solid var(--c-line); } }
