/* =====================================================================
   Construction (js/views/construction.js and its dialogs): the projects, their books, flats and sales.
   Built on the chit pages' layout (list on the left, the project on the right).
   ===================================================================== */

.cn-pill-btn { border: 0; cursor: pointer; font: inherit; }
.cn-pad { padding: 12px 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.cn-sec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cn-sec h4 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ocean-900, #0a2e4f); }
.cn-sec h4 svg { width: 15px; height: 15px; color: var(--ocean-600, #0b7cbd); }
.cn-sec h4 small { font-weight: 500; font-size: 11.5px; color: var(--text-muted, #7a858f); }
.cn-sec .btn + .btn, .cn-sec .cn-agchip + .btn { margin-left: 2px; }

/* overview */
.cn-ov { padding: 12px 14px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.cn-card { background: rgba(255, 255, 255, 0.62); border: 1px solid var(--glass-border, #d6e2ec); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cn-figs { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cn-figs th { text-align: left; font-weight: 500; color: var(--text-secondary, #4b5560); padding: 3px 0; }
.cn-figs td { text-align: right; font-variant-numeric: tabular-nums; padding: 3px 0; }
.cn-figs tr.cn-total th, .cn-figs tr.cn-total td { border-top: 1px solid var(--hairline, #dbe3ea); font-weight: 700; padding-top: 5px; }
.cn-timeline { display: flex; flex-wrap: wrap; gap: 4px; }
.cn-tl { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; background: #eef2f6; color: #52657a; max-width: 100%; }
.cn-tl svg { width: 11px; height: 11px; flex: none; }
.cn-tl small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.cn-tl.done { background: #e3f6ec; color: #13703f; }
.cn-tl.in_progress { background: #fff4dc; color: #9a5b00; }
.cn-bars { display: flex; flex-direction: column; gap: 5px; }
.cn-bar { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.cn-bar span { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-bar span svg { width: 12px; height: 12px; flex: none; color: var(--ocean-600, #0b7cbd); }
.cn-bar i { height: 8px; border-radius: 99px; background: #e6edf3; overflow: hidden; }
.cn-bar em { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f0b44b, #d9822b); }
.cn-shares { display: flex; height: 26px; border-radius: 8px; overflow: hidden; font-size: 11px; font-weight: 650; }
.cn-shares span { display: grid; place-items: center; color: #fff; white-space: nowrap; overflow: hidden; padding: 0 4px; min-width: 0; }
.cn-shares span:nth-child(5n+1) { background: #0b7cbd; } .cn-shares span:nth-child(5n+2) { background: #13a89a; } .cn-shares span:nth-child(5n+3) { background: #7b5bd6; }
.cn-shares span:nth-child(5n+4) { background: #d9822b; } .cn-shares span:nth-child(5n+5) { background: #c0437a; }
.cn-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.cn-recent li { display: grid; grid-template-columns: 48px 16px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.cn-recent li svg { width: 13px; height: 13px; }
.cn-recent li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-unitbar { display: flex; height: 22px; border-radius: 7px; overflow: hidden; font-size: 11px; font-weight: 700; color: #fff; }
.cn-unitbar span { display: grid; place-items: center; min-width: 18px; }
.cn-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 11px; color: var(--text-muted, #7a858f); }
.cn-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.u-sold, .cn-unit.sold { --u: #13703f; } .u-booked, .cn-unit.booked { --u: #2457b3; } .u-avail, .cn-unit.avail { --u: #8aa0b4; }
.u-owner, .cn-unit.owner { --u: #7b2f9a; } .u-handed, .cn-unit.handed { --u: #0b7064; } .u-late { --u: #c62828; }
.cn-unitbar .u-sold, .cn-unitbar .u-booked, .cn-unitbar .u-avail, .cn-unitbar .u-owner, .cn-legend i { background: var(--u); }

/* flats */
.cn-units { display: flex; flex-wrap: wrap; gap: 14px; }
.cn-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cn-block > b { font-size: 12px; color: var(--text-secondary, #4b5560); }
.cn-floor { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cn-floor-no { width: 22px; text-align: right; font-size: 10.5px; color: var(--text-muted, #7a858f); font-weight: 700; }
.cn-unit { width: 66px; height: 44px; border-radius: 9px; border: 1.5px solid var(--u); background: color-mix(in srgb, var(--u) 12%, #fff); color: var(--u); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; padding: 0 3px; }
.cn-unit b { font-size: 12.5px; line-height: 1; }
.cn-unit small { font-size: 9.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-unit:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--u) 22%, transparent); }
.cn-unit.late { box-shadow: inset 0 -3px 0 #c62828; }

/* stages, plans and other row editors */
.cn-rows { display: flex; flex-direction: column; gap: 5px; }
.cn-row { display: grid; gap: 6px; align-items: center; }
.cn-row input, .cn-row select { min-width: 0; width: 100%; }
.cn-stage { grid-template-columns: minmax(0, 2.2fr) 70px 120px 150px 30px; }
.cn-stage.dev { grid-template-columns: minmax(0, 2.4fr) 160px 30px; }
.cn-stage-head { display: grid; grid-template-columns: minmax(0, 2.2fr) 70px 120px 150px 30px; gap: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #7a858f); }
.cn-stage-head.dev { grid-template-columns: minmax(0, 2.4fr) 160px 30px; }
.cn-stage-head.plan, .cn-plan { grid-template-columns: minmax(0, 2fr) 64px 110px minmax(0, 1.3fr) 140px 30px; }
.cn-plan .cn-days { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-muted, #7a858f); }
.cn-plan .cn-days input { width: 60px; }
.cn-plan [hidden] { display: none !important; }
.cn-party { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) 110px minmax(0, 1.4fr) 90px 110px 30px; }
.cn-partner { grid-template-columns: minmax(0, 1.6fr) 120px 90px 60px 30px; }
.cn-share { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 90px 16px; }
.cn-share b small { font-weight: 500; }
.cn-tpls { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* the wizard */
.cn-wizard-modal .modal-body { min-height: 420px; }
.cn-wiz { display: flex; flex-direction: column; gap: 12px; }
.cn-steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.cn-steps li { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #eef2f6; font-size: 12px; color: #52657a; }
.cn-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 11px; font-weight: 700; }
.cn-steps li span svg { width: 12px; height: 12px; }
.cn-steps li.on { background: var(--ocean-600, #0b7cbd); color: #fff; }
.cn-steps li.on span { color: var(--ocean-700, #0a5a8c); }
.cn-steps li.done { background: #e3f6ec; color: #13703f; }
.cn-step-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cn-kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cn-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid #d3dee8; background: #f8fbfd;
    text-align: left; cursor: pointer; font: inherit; color: inherit; }
.cn-kind b { font-size: 14px; }
.cn-kind small { color: var(--text-secondary, #4b5560); font-size: 12px; line-height: 1.4; }
.cn-kind-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #e6eef5; color: var(--ocean-700, #0a5a8c); }
.cn-kind-ico svg { width: 18px; height: 18px; }
.cn-kind.on { border-color: var(--ocean-600, #0b7cbd); background: #eef6fc; box-shadow: 0 0 0 3px rgba(11, 124, 189, .15); }
.cn-kind.on .cn-kind-ico { background: var(--ocean-600, #0b7cbd); color: #fff; }
.cn-area .row { gap: 6px; }
.cn-area .row input { flex: 1; min-width: 0; }
.cn-area .row select { width: 110px; }
.cn-made-list { padding: 10px 12px; border-radius: 12px; background: #f6f9fb; border: 1px dashed #c9d6e2; font-size: 12.5px; }
.cn-made-list ul { margin: 6px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.cn-made-list li { display: flex; gap: 6px; align-items: baseline; }
.cn-made-list svg { width: 13px; height: 13px; flex: none; color: var(--ocean-600, #0b7cbd); }
.cn-heads { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.cn-heads .date-chip svg, .cn-headchips .date-chip svg { width: 12px; height: 12px; margin-right: 3px; }
.cn-headchips { display: flex; flex-wrap: wrap; gap: 4px; }
.cn-headchips small { opacity: .75; margin-left: 3px; }
.link-btn { border: 0; background: none; padding: 0 0 0 6px; color: var(--ocean-600, #0b7cbd); font: inherit; font-size: 11px; cursor: pointer; text-transform: none; }

/* costs, extras, partners, loans, accounts, agreements */
.cn-budget { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-muted, #7a858f); }
.cn-budget i { flex: 1; height: 8px; border-radius: 99px; background: #e6edf3; overflow: hidden; }
.cn-budget em { display: block; height: 100%; background: #13a89a; border-radius: 99px; }
.cn-budget em.over { background: #c62828; }
.cn-extras { display: flex; flex-direction: column; gap: 6px; }
.cn-extra { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--glass-border, #d6e2ec); background: rgba(255, 255, 255, .7); }
.cn-extra.cancelled { opacity: .6; }
.cn-extra-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cn-extra-main small { font-size: 11.5px; }
.cn-extra-figs { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cn-extra-acts { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cn-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.cn-partner { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--glass-border, #d6e2ec); background: rgba(255, 255, 255, .7); min-width: 0; }
.cn-partner-head { display: flex; align-items: center; gap: 8px; }
.cn-partner-head small { display: block; font-size: 11px; }
.cn-share { font-size: 18px; color: var(--ocean-700, #0a5a8c); }
.cn-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cn-account { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .7); border: 1px solid var(--glass-border, #d6e2ec); min-width: 0; }
.cn-account b { white-space: nowrap; }
.cn-account small { display: block; font-size: 11px; }
.cn-account.common { border-style: dashed; }
.cn-ag-list { display: flex; flex-direction: column; gap: 6px; }
.cn-ag { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--glass-border, #d6e2ec); background: rgba(255, 255, 255, .7); }
.cn-ag small { display: block; font-size: 11.5px; color: var(--text-muted, #7a858f); }
.cn-ag.done { border-color: #a9dcbd; }
.cn-agchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
    border: 1px solid #c9d6e2; background: #fff; color: var(--ocean-700, #0a5a8c); }
.cn-agchip svg { width: 12px; height: 12px; }
.cn-agchip.done { background: #e5f6ec; border-color: #a9dcbd; color: #13703f; }
.cn-agchip.draft { background: #fff4dc; border-color: #f1d08c; color: #9a5b00; }
.cn-agchip.make { border-style: dashed; }
.cn-dues td .badge { white-space: nowrap; }
.cn-close ul { margin: 6px 0; padding-left: 18px; }
.cg-files { display: flex; flex-direction: column; gap: 4px; }
.cg-file { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cg-file a { display: inline-flex; align-items: center; gap: 4px; }
.cg-file a svg { width: 13px; height: 13px; }
.cg-file small { color: var(--text-muted, #7a858f); }
.cn-upload { gap: 6px; align-items: center; }

/* a flat's sale */
.cn-sale { display: flex; flex-direction: column; gap: 10px; }
.cn-sale-head { display: flex; flex-direction: column; gap: 10px; }
.cn-sale-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.cn-sale-figs span { padding: 8px 10px; border-radius: 12px; background: #f4f8fb; display: flex; flex-direction: column; }
.cn-sale-figs small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #7a858f); }
.cn-sale-figs b { font-size: 15px; }
.cn-saleflow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cn-saleflow li { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; position: relative; font-size: 11.5px; color: var(--text-muted, #7a858f); }
.cn-saleflow li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef2f6; z-index: 1; }
.cn-saleflow li span svg { width: 14px; height: 14px; }
.cn-saleflow li::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: #dbe3ea; }
.cn-saleflow li:first-child::before { display: none; }
.cn-saleflow li.done span { background: #13a89a; color: #fff; }
.cn-saleflow li.done::before, .cn-saleflow li.on::before { background: #13a89a; }
.cn-saleflow li.on span { background: var(--ocean-600, #0b7cbd); color: #fff; box-shadow: 0 0 0 4px rgba(11, 124, 189, .15); }
.cn-saleflow li.on b, .cn-saleflow li.done b { color: var(--ocean-900, #0a2e4f); }
.cn-saleflow small { font-size: 10.5px; }
.cn-cancelled { padding: 8px 12px; border-radius: 10px; background: #fdf1f1; color: #a12828; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.cn-sale-acts { gap: 6px; }
.cn-sale-body { min-height: 180px; }

@media (max-width: 900px) {
    .cn-kind-grid { grid-template-columns: minmax(0, 1fr); }
    .cn-stage, .cn-stage-head { grid-template-columns: minmax(0, 1fr) 60px 100px 30px; }
    .cn-stage [name=sdue], .cn-stage-head span:nth-child(4) { display: none; }
    .cn-party { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; }
    .cn-party [name=paddr], .cn-party [name=prel] { grid-column: span 2; }
    .cn-stage-head.plan { display: none; }
    .cn-plan { grid-template-columns: minmax(0, 1fr) 60px 30px; }
    .cn-plan [name=amount], .cn-plan [name=when], .cn-plan .cn-due, .cn-plan .cn-days { grid-column: span 2; }
    .cn-saleflow b { font-size: 10.5px; }
    .cn-ov { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .cn-partner { grid-template-columns: minmax(0, 1fr) 80px 30px; }
    .cn-partner [name=mphone] { grid-column: 1 / -1; }
    .cn-unit { width: 58px; }
    .cn-saleflow small { display: none; }
}

.cn-recent li.muted { display: block; }

.cn-plan .cn-due { min-width: 0; }
.cn-plan .cn-due > * { width: 100%; }

/* ---------------------------------------------------------------- the top bar: a slim card with Projects | Accounts, and a slim strip of figures */
.cn-page { grid-template-rows: auto minmax(0, 1fr); }
.cn-top, .cn-strip { min-height: 46px; height: 46px; box-sizing: border-box; border-radius: 14px; border: 1px solid var(--glass-border, #d6e2ec);
    background: var(--card-bg, rgba(255, 255, 255, 0.82)); box-shadow: 0 1px 2px rgba(16, 52, 84, 0.05); }
.cn-top { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 7px; min-width: 0; }
.cn-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--grad-navy, #0b2038); color: #fff; }
.cn-mark svg { width: 15px; height: 15px; }
.cn-switch { position: relative; flex: 1; display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: 10px; background: rgba(214, 227, 237, 0.75);
    border: 1px solid var(--hairline, #dbe3ea); min-width: 0; }
.cn-switch-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 8px; background: var(--grad-navy, #0b2038);
    box-shadow: 0 3px 10px rgba(11, 32, 56, 0.25); transition: transform 0.17s cubic-bezier(0.4, 0, 0.2, 1); }
.cn-switch.accounts .cn-switch-thumb { transform: translateX(100%); }
.cn-switch-opt { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; border-radius: 8px;
    font-size: 12.5px; font-weight: 650; color: var(--text-secondary, #4b5560); text-decoration: none; user-select: none; transition: color 0.17s; white-space: nowrap; }
.cn-switch-opt svg { width: 14px; height: 14px; }
.cn-switch-opt:hover { color: var(--ocean-800, #0a3f66); }
.cn-switch-opt.active { color: #fff; }
.cn-switch-opt:focus-visible { outline: 2px solid var(--ocean-400, #4aa8de); outline-offset: 1px; }
.cn-strip { display: flex; align-items: center; gap: 4px; padding: 0 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; min-width: 0; }
.cn-strip::-webkit-scrollbar { display: none; }
.cn-chip { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 5px; border-radius: 10px; flex: 0 0 auto; min-width: 0;
    background: var(--surface-sunken, #f1f5f9); border: 1px solid transparent; }
.cn-chip.clickable { cursor: pointer; }
.cn-chip.clickable:hover { border-color: var(--ocean-300, #8cc6ea); background: #fff; }
.cn-chip-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #e2ecf4; color: var(--ocean-700, #0a5a8c); flex: none; }
.cn-chip-ico svg { width: 13px; height: 13px; }
.cn-chip-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.cn-chip-text small { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted, #7a858f); white-space: nowrap; }
.cn-chip-text b { font-size: 13.5px; font-weight: 750; color: var(--ocean-900, #0a2e4f); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cn-chip-text b small { font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.cn-chip.good .cn-chip-ico { background: #dff3e6; color: #11703a; }
.cn-chip.warn { background: #fff3e6; }
.cn-chip.warn .cn-chip-ico { background: #fde4d6; color: #b4472a; }
.cn-chip.highlight { background: #fbf3dd; }
.cn-chip.highlight .cn-chip-ico { background: #f8e6b8; color: #8a5b00; }
.cn-chip.note .cn-chip-ico { background: #fdf0cc; color: #8a5b00; }
.cn-strip-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--text-muted, #7a858f); white-space: nowrap; }
.cn-strip-meta svg { width: 11px; height: 11px; }

/* Accounts */
.cn-acct-head .ab-meta { flex-wrap: wrap; }
.cn-stmt .ca-stmt-what .kind-chip { margin-right: 5px; vertical-align: -3px; }

/* a construction project's entry, in the journal and in statements */
.cn-tag { display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 6px; margin-right: 5px; border-radius: 999px; flex: none;
    font-size: 10px; font-weight: 700; letter-spacing: 0.02em; background: #fbefd5; color: #8a5300; border: 1px solid #f0d49a; white-space: nowrap; vertical-align: 1px; }
.cn-tag svg { width: 10px; height: 10px; }
.entry-text .cn-tag { align-self: center; }
.ed-fact.cn-fact { background: #fbefd5; color: #8a5300; }

/* agreements */
.cn-ag-sum { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.cn-ag-sum > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-sunken, #f1f5f9); color: var(--text-secondary, #4b5560); }
.cn-ag-sum > span svg { width: 13px; height: 13px; }
.cn-ag-sum > span.good { background: #e3f6ec; color: #13703f; }
.cn-ag-sum > span.warn { background: #fff4dc; color: #9a5b00; }
.cn-ag-sum > span.grow { background: none; padding: 0; flex: 1; }
.cn-ag.rich { align-items: flex-start; padding: 10px 12px; }
.cn-ag.rich > .chip-icon { margin-top: 2px; }
.cn-ag.make { border-style: dashed; background: transparent; }
.cn-ag-body { display: flex; flex-direction: column; gap: 4px; }
.cn-ag-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cn-ag-line .badge svg { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
.cn-ag-line.sub { font-size: 12px; color: var(--text-secondary, #4b5560); gap: 6px; }
.cn-ag-line.sub > svg { width: 12px; height: 12px; color: var(--text-muted, #7a858f); }
.cn-ag-about { margin-left: auto; padding: 2px 9px; border-radius: 8px; background: #eef5fb; color: var(--ocean-800, #0a3f66); }
.cn-ag-facts { display: flex; flex-wrap: wrap; gap: 4px; }
.cn-ag-fact { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--surface-sunken, #f1f5f9); color: var(--text-secondary, #4b5560); }
.cn-ag-fact svg { width: 11px; height: 11px; }
.cn-ag-fact.good { background: #e3f6ec; color: #13703f; }
.cn-ag-fact.warn { background: #fff4dc; color: #9a5b00; }
.cn-ag-fact.muted { color: var(--text-muted, #7a858f); background: transparent; border: 1px dashed var(--hairline, #dbe3ea); }
.cn-ag-fact code { font-size: 10.5px; }
.cn-ag-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.cn-ag-acts small { font-size: 10.5px; white-space: nowrap; }
.cn-ag.rich .badge.bad { background: #fdecec; color: #a12828; }
a.cn-account { text-decoration: none; color: inherit; }
a.cn-account:hover { border-color: var(--ocean-300, #8cc6ea); background: #fff; }

/* adding a cost */
.cn-cost-form .xp-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr); }
.cn-qty { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); gap: 8px; }
.cn-head-grid { max-height: 196px; overflow-y: auto; }
.cn-head-grid .cat-tile[hidden] { display: none; }
.cn-cost-form [data-new-head] { margin-top: 4px; }
.cn-cost-form .xp-cat-find { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.cn-cost-form .xp-cat-find > svg { width: 13px; height: 13px; color: var(--text-muted, #7a858f); }
.cn-cost-form .xp-cat-search { margin-left: 0; width: 190px; }

/* partners' capital */
.cn-partner-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.cn-partner-pick .date-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; }
.cn-partner-pick .date-chip svg { width: 12px; height: 12px; }
.cn-cap-preview { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-sunken, #f1f5f9); font-size: 12px; color: var(--text-secondary, #4b5560); }
.cn-cap-preview:empty { display: none; }
.cn-cap-preview svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--ocean-600, #0b7cbd); }

@media (max-width: 900px) {
    .cn-cost-form .xp-grid { grid-template-columns: minmax(0, 1fr); }
    .cn-ag-about { margin-left: 0; }
    .cn-ag.rich { flex-wrap: wrap; }
    .cn-ag-acts { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}
@media (max-width: 600px) {
    .cn-top, .cn-strip { height: auto; min-height: 44px; }
    .cn-qty { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); }
    .cn-cost-form .xp-cat-search { width: 130px; }
}

/* agreements: laid out like Host a Chit's (figures, then one table with what is still to make) */
.cn-ag-tiles { padding: 10px 12px 6px; }
.cn-ag-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 12px 8px; }
.cn-ag-bar .small svg { width: 12px; height: 12px; vertical-align: -2px; }
.cn-ag-wrap { overflow-x: auto; }
.cn-ag-table td { vertical-align: top; }
.cn-ag-table tbody tr.clickable:hover td { background: var(--surface-hover, #f3f8fc); }
.cn-ag-no { display: inline-flex; align-items: flex-start; gap: 7px; }
.cn-ag-no > svg { width: 15px; height: 15px; margin-top: 2px; color: var(--ocean-600, #0b7cbd); flex: none; }
.cn-ag-no > span { display: flex; flex-direction: column; line-height: 1.25; }
.cn-ag-no small { font-size: 11px; color: var(--text-muted, #7a858f); }
.cn-ag-sub { display: block; font-size: 10.5px; }
.cn-ag-cov { display: block; max-width: 220px; }
.cn-ag-marks { display: inline-flex; gap: 2px; margin-left: 4px; }
.cn-ag-marks .badge { padding: 0 4px; }
.cn-ag-marks .badge svg { width: 10px; height: 10px; }
.cn-ag-table .badge svg { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
.cn-ag-missing td { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(201, 154, 59, 0.05) 8px 16px); }
.cn-ag-foot { padding: 6px 12px 12px; margin: 0; }
@media (max-width: 900px) { .cn-ag-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* a statement line stays on one line: the kind, the project tag, then the text cut short (the whole of it is the tooltip) */
.cn-stmt .ca-stmt-what { max-width: 0; width: 100%; }
.cn-stmt-line { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; }
.cn-stmt-line > .kind-chip, .cn-stmt-line > .cn-tag { flex: none; margin: 0; }
.cn-stmt-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-stmt td { vertical-align: middle; }
