/* Shared workflow and review improvements. Financial sources remain server-owned. */
.bm-app .bm-nav-group{padding:5px 0;border-bottom:1px solid var(--ui-line)}
.bm-app .bm-nav-group>strong{display:block;padding:7px 12px;color:var(--ui-muted);font-size:12px}
.bm-app .bm-nav-menu a[aria-current=page]{background:var(--ui-primary-soft);color:var(--ui-primary);font-weight:800}
.bm-app .ui-workflow,.bm-app .ui-task-note{padding:14px 18px;margin:14px 0 20px;background:var(--ui-primary-soft);border:1px solid var(--ui-line-strong);border-radius:12px}
.bm-app .ui-workflow ol{display:flex;gap:10px;flex-wrap:wrap;list-style:none;padding:0;margin:12px 0}
.bm-app .ui-workflow li>span{display:block;padding:8px 4px;border-bottom:2px solid var(--ui-line-strong);color:var(--ui-muted)}
.bm-app .ui-workflow li[aria-current=step]>span{border-bottom-color:var(--ui-primary);color:var(--ui-primary);font-weight:800}
.bm-app .ui-workflow small,.bm-app .ui-task-note p{display:block;margin:6px 0 0;line-height:1.6}
.bm-app .ui-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0;padding:0;border-bottom:1px solid var(--ui-line)}
.bm-app .ui-tabs button{padding:11px 16px;min-height:44px;border:1px solid var(--ui-line-strong);border-radius:8px 8px 0 0;background:white;color:var(--ui-primary);font:inherit;cursor:pointer}
.bm-app .ui-tabs button[aria-selected=true]{background:var(--ui-primary);color:white}
.bm-app [data-ui-tab][hidden],.bm-app [data-ui-hidden]{display:none!important}
.bm-app .ui-form-preview{padding:12px;margin:12px 0;border:1px solid var(--ui-line-strong);border-radius:9px;background:var(--ui-primary-soft);line-height:1.6;font-variant-numeric:tabular-nums}
.bm-app .ui-recovery{padding:12px;border:1px solid var(--ui-danger);background:var(--ui-danger-soft);border-radius:9px}
.bm-app .ui-mini-menu>summary{list-style:none;cursor:pointer;text-align:center;border:1px solid var(--ui-line-strong);border-radius:8px;min-width:40px;min-height:40px;padding:4px 10px;font-size:24px}
.bm-app .ui-mini-menu>summary::-webkit-details-marker{display:none}
.bm-app .ui-mini-panel{position:fixed;z-index:100;width:225px;max-width:calc(100vw - 16px);max-height:70vh;overflow:auto;background:white;border:1px solid var(--ui-line-strong);border-radius:10px;box-shadow:0 10px 25px #152b4326;padding:6px;white-space:normal}
.bm-app .ui-mini-panel a{display:block;padding:11px 12px;border-radius:6px;text-decoration:none;color:var(--ui-primary)}
.bm-app .ui-mini-panel a:hover{background:var(--ui-primary-soft)}
.bm-app .ui-local-tools{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:12px 0}
.bm-app .ui-local-tools label{min-width:180px;flex:1;margin:0}.bm-app .ui-local-tools input{margin:6px 0}
.bm-app .ui-paste-dialog{width:min(760px,calc(100vw - 24px));max-height:85vh;overflow:auto;border:1px solid var(--ui-line-strong);border-radius:14px;padding:20px;color:var(--ui-ink)}
.bm-app .ui-paste-dialog textarea{display:block;width:100%;min-height:120px;margin:12px 0}
.bm-app .ui-paste-dialog pre{white-space:pre-wrap;max-height:250px;overflow:auto}
.bm-app .ui-mobile-month{display:none}
.bm-app .ui-next-task{display:block;margin-top:7px;color:var(--ui-primary);font-size:13px;text-decoration:underline}
.bm-app .ui-form-error-link{color:var(--ui-danger)}
@media(max-width:600px){
 .bm-app .ui-workflow ol{display:grid;grid-template-columns:1fr 1fr}.bm-app .ui-tabs button{flex:1;font-size:14px}
 .bm-app .ui-mobile-month{display:block;margin:14px 0}
 .bm-app table[data-ui-card]{width:100%;min-width:0!important;table-layout:auto}
 .bm-app table[data-ui-card]>thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .bm-app table[data-ui-card]>:is(tbody,tfoot){display:block}
 .bm-app table[data-ui-card]>:is(tbody,tfoot)>tr{display:block;border:1px solid var(--ui-line-strong);border-radius:10px;padding:10px;margin:12px 0;background:white}
 .bm-app table[data-ui-card]>:is(tbody,tfoot)>tr>td{display:grid;grid-template-columns:minmax(100px,35%) minmax(0,1fr);gap:10px;width:auto!important;min-width:0!important;max-width:none;white-space:normal!important;padding:8px;border:0;text-align:left;overflow-wrap:anywhere;font-size:14px}
 .bm-app table[data-ui-card]>:is(tbody,tfoot)>tr>td::before{content:attr(data-ui-label);color:var(--ui-muted);font-size:13px;font-weight:600}
 .bm-app table[data-ui-card]>:is(tbody,tfoot)>tr>td[colspan]{display:block}
 .bm-app .bank-rows td:nth-child(3){min-width:0}
 .bm-app .ui-local-tools{display:block}
 .bm-app button:not(.bm-nav-icon){min-height:40px}
}
@media print{.bm-app .ui-tabs,.bm-app .ui-local-tools,.bm-app .ui-task-note,.bm-app .ui-workflow,.bm-app .ui-mini-menu,.bm-app .ui-form-preview,.bm-app .ui-mobile-month{display:none!important}.bm-app [data-ui-tab][hidden],.bm-app [data-ui-hidden]{display:revert!important}}

.bm-app .ui-advanced-filter{grid-column:1/-1;padding:10px;border:1px solid var(--ui-line);border-radius:8px}.bm-app .ui-advanced-filter>summary{cursor:pointer;padding:6px;font-weight:700}.bm-app .ui-advanced-filter[open]{display:block}.bm-app .ui-advanced-filter label{display:inline-block;min-width:180px;margin:8px 12px 0 0;vertical-align:top}

.bm-app [data-ui-effects]>label{display:block;margin:18px 0;font-weight:700}.bm-app [data-ui-effects]>label>select{display:block;width:100%;max-width:480px;margin-top:8px;min-height:44px}

/* Rent contract identity is a text link in every viewport. */
.bm-app table.bm-rent-month-contracts a.bm-record-link,
.bm-app table.bm-rent-list a.bm-record-link,
.bm-app table.bm-rent-month-contracts a.bm-record-link:hover,
.bm-app table.bm-rent-list a.bm-record-link:hover {
 display:inline; width:auto; min-height:0; margin:0; padding:0;
 border:0; border-radius:0; background:transparent; box-shadow:none;
 color:var(--ui-primary); text-align:left; text-decoration:underline;
}
.bm-app .rent-mobile-label,.bm-app .rent-tablet-paid{display:none}
.bm-app .rent-contract-line{margin-top:5px}
@media(min-width:601px) and (max-width:1100px){
 .bm-app table.bm-rent-month-contracts{min-width:0;table-layout:fixed;font-size:13px}
 .bm-app .bm-rent-month-contracts .rent-tablet-paid{display:block}
 .bm-app .bm-rent-month-contracts tr>:nth-child(5){display:none}
 .bm-app .bm-rent-month-contracts tr>:nth-child(1){width:auto}
 .bm-app .bm-rent-month-contracts tr>:nth-child(2){width:22%}
 .bm-app .bm-rent-month-contracts tr>:nth-child(3){width:11%}
 .bm-app .bm-rent-month-contracts tr>:nth-child(4){width:17%}
 .bm-app .bm-rent-month-contracts tr>:nth-child(6){width:17%}
 .bm-app .bm-rent-month-contracts tr>:last-child{width:56px}
 .bm-app .bm-rent-month-contracts td,.bm-app .bm-rent-month-contracts th{padding:12px 6px}
 .bm-app .bm-rent-month-contracts .rent-tenant-line{white-space:nowrap}
 .bm-app .bm-rent-month-contracts .bm-date-start,.bm-app .bm-rent-month-contracts .bm-date-end{display:block}
}
@media(max-width:600px){
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr{position:relative;padding-top:48px}
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td.rent-identity,
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td.rent-balances{display:block}
 .bm-app .bm-rent-month-contracts td.rent-identity::before,
 .bm-app .bm-rent-month-contracts td.rent-balances::before{display:none}
 .bm-app .bm-rent-month-contracts .rent-tenant-line,
 .bm-app .bm-rent-month-contracts .rent-contract-line,
 .bm-app .bm-rent-month-contracts .rent-balance-line{display:grid;grid-template-columns:minmax(100px,35%) minmax(0,1fr);gap:10px}
 .bm-app .bm-rent-month-contracts .rent-contract-line,
 .bm-app .bm-rent-month-contracts .rent-balance-line+.rent-balance-line{margin-top:12px}
 .bm-app .bm-rent-month-contracts .rent-mobile-label{display:block;color:var(--ui-muted);font-size:13px;font-weight:600}
 .bm-app .bm-rent-month-contracts .rent-period-value{display:block}
 .bm-app .bm-rent-month-contracts .bm-date-start,.bm-app .bm-rent-month-contracts .bm-date-end{display:block}
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td:has(>.ui-mini-menu){position:absolute;top:10px;right:10px;display:block;padding:0;width:44px!important}
 .bm-app .bm-rent-month-contracts td:has(>.ui-mini-menu)::before{display:none}
 .bm-app .bm-rent-month-contracts .ui-mini-menu>summary{width:44px;min-width:44px;height:40px;padding:0}
}

.bm-app .draft-discount-editor>summary{cursor:pointer;display:list-item;padding:12px 0;font-size:18px}
.bm-app .draft-discount-summary{display:inline-block;margin-left:16px;color:var(--ui-muted);font-size:14px}
.bm-app .draft-discount-table{width:100%;min-width:960px;table-layout:fixed}
.bm-app .draft-discount-table th,.bm-app .draft-discount-table td{padding:12px;vertical-align:top}
.bm-app .draft-discount-table th:first-child{width:90px}
.bm-app .draft-discount-table th:nth-child(3){width:150px}
.bm-app .draft-discount-table th:last-child{width:205px}
.bm-app .draft-discount-table input.control,.bm-app .draft-discount-table select.control{width:100%;min-width:0}
.bm-app .draft-discount-row-form{display:grid;gap:10px;margin:0}
.bm-app .draft-discount-row-form .check{display:flex;gap:8px;align-items:start;font-size:13px}
.bm-app .draft-discount-row-form input[type=checkbox]{width:18px;min-width:18px;height:18px;margin-top:2px}
@media(max-width:600px){.bm-app .draft-discount-summary{display:block;margin:6px 0 0 18px}}

/* Discount row forms share fields across table cells; mobile stacks the same fields. */
@media(max-width:600px){
 .bm-app #draft-discounts .table-region{overflow:visible}
 .bm-app .draft-discount-table{display:block;min-width:0;width:100%;table-layout:auto}
 .bm-app .draft-discount-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .bm-app .draft-discount-table tbody{display:grid;gap:14px;width:100%}
 .bm-app .draft-discount-table tbody tr{display:block;min-width:0;padding:16px;border:1px solid var(--ui-line-strong);border-radius:12px;background:#fff}
 .bm-app .draft-discount-table tbody th,.bm-app .draft-discount-table tbody td{display:block;box-sizing:border-box;width:100%!important;min-width:0;padding:8px 0;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
 .bm-app .draft-discount-table tbody th{font-size:17px;padding-top:0}
 .bm-app .draft-discount-table td[data-discount-label]::before{content:attr(data-discount-label);display:block;margin-bottom:6px;color:var(--ui-muted);font-size:13px;font-weight:600}
 .bm-app .draft-discount-table input.control,.bm-app .draft-discount-table select.control{font-size:16px;max-width:100%;box-sizing:border-box}
 .bm-app .draft-discount-row-form{width:100%;min-width:0;margin-top:6px}
 .bm-app .draft-discount-row-form .save-button{width:100%;min-width:0}
 .bm-app #draft-discounts .ui-recovery{min-width:0;overflow-wrap:anywhere}
}

.bm-app .draft-discount-unit-toggle{display:none}
.bm-app .draft-discount-save{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin:16px 0}
.bm-app .draft-discount-save .check{display:flex;align-items:center;gap:8px}
.bm-app .draft-discount-table th:last-child{width:auto}
@media(max-width:600px){
 .bm-app .draft-discount-save{align-items:stretch;flex-direction:column}
 .bm-app .draft-discount-unit-title{display:none}
 .bm-app .draft-discount-unit-toggle{display:flex;justify-content:space-between;align-items:center;width:100%;padding:0;border:0;background:transparent;color:var(--ui-text);font:inherit;font-weight:700;text-align:left;cursor:pointer}
 .bm-app .draft-discount-unit:not(.is-open)>td{display:none}
 .bm-app .draft-discount-unit.is-open .draft-discount-unit-toggle .draft-discount-unit-arrow{transform:rotate(180deg)}
}

@media(max-width:600px){
 .bm-app .draft-discount-unit-toggle{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px}
 .bm-app .draft-discount-unit-summary{font-size:12px;font-weight:500;color:var(--ui-primary);text-align:right;overflow-wrap:anywhere;line-height:1.5}
 .bm-app .draft-discount-unit-summary[hidden]{display:none}
 .bm-app .draft-discount-unit-arrow{grid-column:3}
}

/* Monthly rent mobile cards: tenant and menu share the header only. */
@media(max-width:600px){
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr{padding:10px;position:relative}
 .bm-app .bm-rent-month-contracts .rent-tenant-line{display:flex;align-items:center;min-height:44px;padding-right:56px;gap:0}
 .bm-app .bm-rent-month-contracts .rent-tenant-line>.rent-mobile-label{display:none}
 .bm-app .bm-rent-month-contracts .rent-tenant-line>a.bm-record-link{font-size:18px;line-height:1.4;font-weight:800;overflow-wrap:anywhere}
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td:has(>.ui-mini-menu){top:18px;right:18px;bottom:auto;left:auto;width:44px!important;padding:0;margin:0;border:0!important;min-height:0}
 .bm-app .bm-rent-month-contracts .ui-mini-menu>summary{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px;line-height:1;padding:0}
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td:not(:has(>.ui-mini-menu)){width:auto!important;margin-right:0;padding-right:8px}
}

@media(max-width:600px){
 .bm-app .bm-rent-month-contracts .ui-mini-menu{padding:0;margin:0;border:0}
}

/* Shared mobile page header: label and icons on row one, title full width below. */
@media(max-width:600px){
 .bm-app header.bm-page-header{display:block;padding-right:0}
 .bm-app .bm-page-header .bm-header-heading{width:100%;min-width:0;box-sizing:border-box;padding-right:0!important}
 .bm-app .bm-page-header .bm-header-heading>.eyebrow{display:flex;align-items:center;box-sizing:border-box;min-height:36px;padding:0!important;margin:0 0 12px;max-width:calc(100% - var(--bm-tools-width,122px));font-size:14px;line-height:1.4;overflow-wrap:anywhere}
 .bm-app .bm-page-header .bm-header-heading>h1{width:100%;box-sizing:border-box;padding-right:0!important;margin-top:0;word-break:keep-all;overflow-wrap:anywhere}
 .bm-app header.bm-page-header:has(.bm-header-heading) .bm-navigation{top:var(--bm-label-top,0px);right:var(--bm-label-right,0px);transform:none}
}

/* Consistent compact top spacing for shared application page headers. */
@media screen {
 .bm-app { --ui-page-top-space:16px; }
 .bm-app > main:has(> header.bm-page-header) { margin-top:0; padding-top:var(--ui-page-top-space); }
 .bm-app > main > header.bm-page-header { margin-top:0; padding-top:0; }
 .bm-app > main > header.bm-page-header .bm-header-heading > .eyebrow { margin-top:0; }
}
@media screen and (max-width:1024px) { .bm-app { --ui-page-top-space:12px; } }
@media screen and (max-width:600px) { .bm-app { --ui-page-top-space:8px; } }

/* Home links use the same outlined tab shape as workflow tabs. */
.bm-app .bm-home-tabs > a { border:1px solid var(--ui-line-strong); border-radius:8px 8px 0 0; }
.bm-app .bm-home-tabs > a:not(.active) { background:#fff; color:var(--ui-primary); }

/* Keep receivables summary amounts and their currency unit together. */
.bm-app .receivables-summary strong { white-space:nowrap; font-size:var(--ui-amount-fit,24px); }
@media(max-width:760px) { .bm-app .receivables-summary strong { font-size:var(--ui-amount-fit,20px); } }
@media screen { .bm-app .receivables-summary.amount-needs-space { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); } }
@media print { .bm-app .receivables-summary strong { font-size:16px; } }

/* Nested receivables details must not inherit the tenant column's minimum width. */
.bm-app .receivables-table > tbody > tr > td:first-child { min-width:185px; }
.bm-app .receivables-months > tbody > tr > td:first-child { min-width:0; }
.bm-app .receivables-months > thead > tr > th:first-child,
.bm-app .receivables-months > tbody > tr > td:first-child { width:clamp(64px,8vw,96px); white-space:nowrap; padding-inline:8px; }
.bm-app .receivables-cell-value { display:block; min-width:0; }
@media(max-width:600px) {
 .bm-app table.receivables-months[data-ui-card] { display:block; }
 .bm-app .receivables-months .receivables-cell-value { overflow-wrap:anywhere; }
 .bm-app .receivables-months .ui-mini-menu { margin:0; }
}

/* Responsive tenant overview: fluid identity and stacked management debt. */
.bm-app .rec-fee-stack { display:none; }
.bm-app .receivables-table { min-width:0; table-layout:fixed; }
.bm-app .receivables-table > thead > tr > th:first-child { width:22%; }
.bm-app .receivables-table > thead > tr > th:nth-child(2) { width:12%; }
.bm-app .receivables-table > thead > tr > th:nth-child(3),
.bm-app .receivables-table > thead > tr > th:nth-child(4),
.bm-app .receivables-table > thead > tr > th:nth-child(5) { width:14%; }
.bm-app .receivables-table > thead > tr > th:nth-child(6) { width:18%; }
.bm-app .receivables-table > thead > tr > th:last-child { width:6%; }
.bm-app .receivables-table > tbody > tr > td:first-child { min-width:0; overflow-wrap:anywhere; }
.bm-app .receivables-table > thead > tr > th { white-space:normal; overflow-wrap:anywhere; }
.bm-app .receivables-month-region { max-width:100%; overflow:auto; }
@media screen and (min-width:601px) and (max-width:1100px) {
 .bm-app .receivables-table > thead > tr > .rec-late-fee,
 .bm-app .receivables-table > tbody > tr > .rec-late-fee { display:none; }
 .bm-app .receivables-table > thead .rec-fee-stack,
 .bm-app .receivables-table > tbody .rec-fee-stack { display:block; margin-top:7px; }
 .bm-app .receivables-table .rec-fee-label { color:var(--ui-muted); font-size:12px; }
 .bm-app .receivables-table > thead > tr > th:first-child { width:19%; }
 .bm-app .receivables-table > thead > tr > th:last-child { width:9%; }
 .bm-app .receivables-table > thead > tr > th:nth-child(2) { width:16%; }
 .bm-app .receivables-table > thead > tr > th:nth-child(3) { width:20%; }
 .bm-app .receivables-table > thead > tr > th:nth-child(5) { width:18%; }
 .bm-app .receivables-table > :is(thead,tbody) > tr > :is(th,td) { padding:10px 6px; font-size:13px; }
 .bm-app .receivables-table > tbody > tr > td.number { white-space:normal; overflow-wrap:anywhere; }
 .bm-app .receivables-table > tbody > tr > td:last-child .ui-mini-menu > summary { min-width:32px; padding-inline:4px; }
}
@media(max-width:600px) { .bm-app .receivables-month-region { overflow:visible; } }

.bm-app .receivables-table > tbody > tr > td > .ui-mini-menu { margin:0; padding:0; border:0; min-width:0; }

/* Monthly detail uses the same two-line debt column on narrower tables. */
@media screen and (min-width:601px) and (max-width:1100px) {
 .bm-app .receivables-months { table-layout:fixed; min-width:0; }
 .bm-app .receivables-months > thead > tr > .rec-month-late,
 .bm-app .receivables-months > tbody > tr > .rec-month-late { display:none; }
 .bm-app .receivables-months .rec-fee-stack { display:block; margin-top:7px; }
 .bm-app .receivables-months > thead > tr > th:first-child,
 .bm-app .receivables-months > tbody > tr > td:first-child { width:12%; }
 .bm-app .receivables-months > thead > tr > th:first-child { white-space:normal; }
 .bm-app .receivables-months > thead > tr > th:nth-child(2) { width:18%; }
 .bm-app .receivables-months > thead > tr > th:nth-child(3) { width:23%; }
 .bm-app .receivables-months > thead > tr > th:nth-child(4) { width:20%; }
 .bm-app .receivables-months > thead > tr > th:nth-child(6) { width:17%; }
 .bm-app .receivables-months > thead > tr > th:last-child { width:10%; }
 .bm-app .receivables-months > :is(thead,tbody) > tr > :is(th,td) { padding:10px 5px; font-size:13px; white-space:normal; overflow-wrap:anywhere; }
 .bm-app .receivables-months .ui-mini-menu { margin:0; padding:0; border:0; }
 .bm-app .receivables-months .ui-mini-menu > summary { min-width:30px; padding-inline:3px; }
}

/* Mobile receivables cards: one full-width heading with a corner action menu. */
.bm-app .rec-mobile-title { display:none; }
@media screen and (max-width:600px) {
 .bm-app .receivables-table[data-ui-card] > tbody > tr[data-recipient],
 .bm-app .receivables-months[data-ui-card] > tbody > tr:has(.rec-month-identity) { position:relative; padding:12px; }
 .bm-app .receivables-table[data-ui-card] > tbody > tr > td.rec-identity,
 .bm-app .receivables-months[data-ui-card] > tbody > tr > td.rec-month-identity { display:flex; align-items:center; min-height:44px; padding:0 56px 0 0; margin-bottom:8px; }
 .bm-app .rec-mobile-title { display:block; font-size:18px; line-height:1.4; font-weight:800; overflow-wrap:anywhere; }
 .bm-app .rec-identity .rec-desktop-identity,
 .bm-app .rec-month-identity .rec-desktop-identity,
 .bm-app .receivables-months[data-ui-card] > tbody > tr > td.rec-month-contract { display:none; }
 .bm-app .receivables-table[data-ui-card] > tbody > tr > td.rec-identity::before,
 .bm-app .receivables-months[data-ui-card] > tbody > tr > td.rec-month-identity::before,
 .bm-app .receivables-table[data-ui-card] > tbody > tr > td.rec-overview-actions::before,
 .bm-app .receivables-months[data-ui-card] > tbody > tr > td.rec-month-actions::before { content:none; }
 .bm-app .receivables-table[data-ui-card] > tbody > tr > td.rec-overview-actions,
 .bm-app .receivables-months[data-ui-card] > tbody > tr > td.rec-month-actions { position:absolute; display:block; top:12px; right:12px; width:44px!important; padding:0; }
 .bm-app .rec-overview-actions .ui-mini-menu,
 .bm-app .rec-month-actions .ui-mini-menu { margin:0; padding:0; border:0; }
 .bm-app .rec-overview-actions .ui-mini-menu > summary,
 .bm-app .rec-month-actions .ui-mini-menu > summary { display:flex; align-items:center; justify-content:center; width:44px; height:44px; min-height:44px; padding:0; }
 .bm-app .receivables-table[data-ui-card] > tbody > tr.receivables-detail { border:0; border-radius:0; background:transparent; margin:0 0 18px; padding:0; }
 .bm-app .receivables-table[data-ui-card] > tbody > tr.receivables-detail > td { padding:0!important; }
 .bm-app .receivables-detail > td > details { margin:0; padding:0; border:0; background:transparent; }
 .bm-app .receivables-detail > td > details > summary { padding:8px 0; font-size:16px; font-weight:700; }
 .bm-app .receivables-month-region { margin:0; }
 .bm-app .receivables-months { margin:8px 0 0; }
}

/* Optional page guidance opens only from its title's question-mark control. */
.bm-app .ui-task-note[hidden] { display:none!important; }
.bm-app button.ui-help-toggle,.bm-app span.ui-help-toggle[role=button] { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:0; margin:0; border:0; border-radius:50%; background:transparent; color:var(--ui-primary); cursor:pointer; }
.bm-app .ui-help-toggle svg { display:block; width:26px; height:26px; }
.bm-app .ui-help-toggle circle { fill:var(--ui-surface); stroke:currentColor; stroke-width:1.7; }
.bm-app .ui-help-toggle text { fill:currentColor; font-family:var(--ui-font); font-size:19px; font-weight:700; }
.bm-app .ui-help-toggle:hover circle,.bm-app .ui-help-toggle[aria-expanded=true] circle { fill:var(--ui-primary-soft); }
@media print { .bm-app .ui-help-toggle { display:none!important; } }

.bm-app .ui-title-with-help { display:inline-flex; align-items:center; gap:6px; max-width:100%; vertical-align:top; }
.bm-app .ui-help-title-text { min-width:0; overflow-wrap:anywhere; }

.bm-app [data-ui-help-panel][hidden] { display:none!important; }

/* Admin page titles share one screen-only scale; printed document titles retain their own rules. */
@media screen {
 .bm-app header.bm-admin-header { --bm-page-title-size:32px; }
 .bm-app header.bm-admin-header h1,
 .bm-app header.bm-admin-header h1#page-title,
 .bm-app header.bm-admin-header h1.page-title {
  font-size:var(--bm-page-title-size);font-weight:800;line-height:1.3;letter-spacing:normal;white-space:normal;
 }
}
@media screen and (max-width:1024px) { .bm-app header.bm-admin-header { --bm-page-title-size:28px; } }
@media screen and (max-width:600px) { .bm-app header.bm-admin-header { --bm-page-title-size:24px; } }

/* Keep optional grid progress and column paste controls out of the current input workflow. */
.bm-app .ui-grid-entry-tools { display:none!important; }

@media screen {
 .bm-app [aria-label="월세 현황 요약"] .card-value { white-space:nowrap;overflow-wrap:normal;word-break:normal;font-size:var(--ui-amount-fit,clamp(1.15rem,2vw,1.55rem)); }
 .bm-app [aria-label="월세 현황 요약"].amount-needs-space { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); }
}

/* Row menus are controls, not full-width disclosure sections. */
.bm-app table:is(.bm-rent-month-contracts,.bm-rent-list) .ui-mini-menu { margin:0;padding:0;border:0;background:transparent; }
@media(min-width:601px) {
 .bm-app table:is(.bm-rent-month-contracts,.bm-rent-list)>tbody>tr>td:has(>.ui-mini-menu) { vertical-align:middle; }
 .bm-app table:is(.bm-rent-month-contracts,.bm-rent-list) .ui-mini-menu>summary { display:flex;align-items:center;justify-content:center;min-height:44px;box-sizing:border-box;line-height:1; }
}

/* Bulk rent preview uses the space available inside its own section. */
.bm-app .bm-rent-bulk-region { container-type:inline-size; overflow:visible; }
.bm-app .bm-rent-bulk-table { width:100%; min-width:0; table-layout:auto; }
.bm-app .bm-rent-bulk-table th,.bm-app .bm-rent-bulk-table td { padding:12px 8px; }
.bm-app .bm-rent-bulk-table .money { white-space:nowrap; }
.bm-app .bulk-period-date { display:block; white-space:nowrap; }
.bm-app .bulk-tenant-action { margin:0; padding:0; border:0; background:transparent; }
.bm-app .bulk-tenant-action > summary { color:var(--ui-primary); text-decoration:underline; list-style:none; overflow-wrap:anywhere; }
.bm-app .bulk-tenant-action > summary::-webkit-details-marker { display:none; }
.bm-app .bulk-individual-link { display:inline-block; padding:8px 10px; margin-top:8px; border:1px solid var(--ui-line-strong); border-radius:8px; }
.bm-app .bulk-contract-number,.bm-app .bulk-table-units { display:block; margin-top:5px; overflow-wrap:anywhere; }
.bm-app .bulk-tax-stacked,.bm-app .bulk-due-stacked,.bm-app .bulk-title-units { display:none; }
.bm-app .bm-rent-bulk-table td.bulk-selection { width:54px; text-align:center; }
.bm-app .bulk-selection-status { display:block; margin-top:4px; font-size:12px; line-height:1.35; white-space:nowrap; }
.bm-app .bulk-unavailable-note { margin-top:8px; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }

@container (max-width:1050px) {
 .bm-app .bm-rent-bulk-table th:nth-child(5),.bm-app .bm-rent-bulk-table td:nth-child(5) { display:none; }
 .bm-app .bm-rent-bulk-table .bulk-tax-stacked { display:block; margin-top:5px; }
 .bm-app .bm-rent-bulk-table td .bulk-stacked-label { color:var(--ui-muted); font-size:12px; }
}
@container (max-width:900px) {
 .bm-app .bm-rent-bulk-table th:nth-child(7),.bm-app .bm-rent-bulk-table td:nth-child(7) { display:none; }
 .bm-app .bm-rent-bulk-table .bulk-due-stacked { display:block; margin-top:5px; font-weight:400; }
}
@container (max-width:650px) {
 .bm-app .bm-rent-bulk-table,.bm-app .bm-rent-bulk-table tbody { display:block; width:100%; }
 .bm-app .bm-rent-bulk-table thead { display:none; }
 .bm-app .bm-rent-bulk-table tbody>tr { display:block; position:relative; padding:16px; margin:12px 0; border:1px solid var(--ui-line-strong); border-radius:12px; }
 .bm-app .bm-rent-bulk-table td { display:grid; grid-template-columns:minmax(76px,32%) minmax(0,1fr); gap:10px; padding:8px 0; border:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
 .bm-app .bm-rent-bulk-table td[data-label]::before { content:attr(data-label); color:var(--ui-muted); font-weight:700; }
 .bm-app .bm-rent-bulk-table td.bulk-selection { position:absolute; right:16px; top:17px; display:block; padding:0; }
 .bm-app .bm-rent-bulk-table td.bulk-identity { display:block; padding:0 72px 12px 0; min-height:68px; box-sizing:border-box; margin-bottom:6px; border-bottom:1px solid var(--ui-line); }
 .bm-app .bm-rent-bulk-table .bulk-tenant-action>summary { font-size:18px; line-height:1.5; }
 .bm-app .bm-rent-bulk-table .bulk-title-units { display:inline; }
 .bm-app .bm-rent-bulk-table .bulk-table-units,.bm-app .bm-rent-bulk-table .bulk-tax-stacked,.bm-app .bm-rent-bulk-table .bulk-due-stacked { display:none; }
 .bm-app .bm-rent-bulk-table td:nth-child(5),.bm-app .bm-rent-bulk-table td:nth-child(7) { display:grid; }
 .bm-app .bm-rent-bulk-table td .bulk-period-date { grid-column:2; }
 .bm-app .bm-rent-bulk-table td[data-label="합계"] { font-weight:700; }
}

/* Fallback for unusually long values that exceed the available table width. */

 .bm-app .bm-rent-bulk-table.bulk-card-mode,.bm-app .bm-rent-bulk-table.bulk-card-mode tbody { display:block; width:100%; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode thead { display:none; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode tbody>tr { display:block; position:relative; padding:16px; margin:12px 0; border:1px solid var(--ui-line-strong); border-radius:12px; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td { display:grid; grid-template-columns:minmax(76px,32%) minmax(0,1fr); gap:10px; padding:8px 0; border:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td[data-label]::before { content:attr(data-label); color:var(--ui-muted); font-weight:700; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td.bulk-selection { position:absolute; right:16px; top:17px; display:block; padding:0; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td.bulk-identity { display:block; padding:0 72px 12px 0; min-height:68px; box-sizing:border-box; margin-bottom:6px; border-bottom:1px solid var(--ui-line); }
 .bm-app .bm-rent-bulk-table.bulk-card-mode .bulk-tenant-action>summary { font-size:18px; line-height:1.5; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode .bulk-title-units { display:inline; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode .bulk-table-units,.bm-app .bm-rent-bulk-table.bulk-card-mode .bulk-tax-stacked,.bm-app .bm-rent-bulk-table.bulk-card-mode .bulk-due-stacked { display:none; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td:nth-child(5),.bm-app .bm-rent-bulk-table.bulk-card-mode td:nth-child(7) { display:grid; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td .bulk-period-date { grid-column:2; }
 .bm-app .bm-rent-bulk-table.bulk-card-mode td[data-label="합계"] { font-weight:700; }


/* Rent cards reserve action space only beside the tenant name. */
@media screen and (max-width:600px) {
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr { padding:12px; }
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td:not(:has(>.ui-mini-menu)) { box-sizing:border-box; width:100%!important; margin:0; padding:8px 0; text-align:right; }
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td:not(:has(>.ui-mini-menu))::before { text-align:left; }
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td.rent-identity { padding:0; margin-bottom:8px; }
 .bm-app .bm-rent-month-contracts .rent-tenant-line { padding-right:52px; text-align:left; }
 .bm-app .bm-rent-month-contracts .rent-contract-line,.bm-app .bm-rent-month-contracts .rent-balance-line { width:100%; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); }
 .bm-app .bm-rent-month-contracts .rent-mobile-label { text-align:left; }
 .bm-app table[data-ui-card].bm-rent-month-contracts>tbody>tr>td:has(>.ui-mini-menu) { top:12px; right:12px; width:44px!important; }
}

/* Master tabs follow their label width and wrap naturally without shrinking text. */
.bm-app .ui-master-tabs{align-items:stretch}
.bm-app .ui-master-tabs button{flex:0 0 auto;width:auto;min-width:0;white-space:nowrap;word-break:keep-all;overflow-wrap:normal}
.bm-app .ui-master-tabs .ui-tab-word{display:inline-block;white-space:nowrap}
@media screen and (max-width:600px){
 .bm-app .ui-master-tabs{gap:6px}
 .bm-app .ui-master-tabs button{box-sizing:border-box;flex:0 0 auto;width:auto;padding:10px 12px;font-size:inherit;line-height:1.4;min-height:44px;white-space:nowrap}
}

/* Review follow-up: the target remains outside the tab panels. */
.bm-app .rent-target-summary{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:18px 0;padding:14px 16px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-primary-soft);overflow-wrap:anywhere}
.bm-app .rent-target-summary strong{font-size:18px}
.bm-app .rent-target-summary>span:last-child{flex-basis:100%;color:var(--ui-muted);font-size:14px}
.bm-app .ui-help-toggle:focus-visible{outline:2px solid var(--ui-primary);outline-offset:2px}
.bm-app .report-stack-extra{display:none}

@media screen {
 .bm-app table.report-compact-mode .report-stack-extra{display:block;margin-top:6px}
 .bm-app table.report-compact-mode .report-stack-source{display:none}
 .bm-app table.report-compact-mode :is(th,td){padding:10px 6px}
 .bm-app table.report-compact-mode th{white-space:normal;word-break:keep-all}
 .bm-app .ui-card-region{overflow:visible}
 .bm-app table[data-ui-card].ui-auto-card-mode{display:block;width:100%;min-width:0!important;table-layout:auto}
 .bm-app table[data-ui-card].ui-auto-card-mode>thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot){display:block;width:100%}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot)>tr{position:relative;display:block;width:100%;border:1px solid var(--ui-line-strong);border-radius:10px;padding:12px;margin:12px 0;background:var(--ui-surface,#fff)}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot)>tr>td{display:grid;grid-template-columns:minmax(76px,40%) minmax(0,1fr);gap:10px;box-sizing:border-box;width:100%!important;min-width:0!important;max-width:none;padding:8px 0;border:0;white-space:normal!important;text-align:right;overflow-wrap:anywhere;font-size:14px}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot)>tr>td::before{content:attr(data-ui-label);color:var(--ui-muted);font-size:13px;font-weight:600;text-align:left}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot)>tr>td[colspan]{display:block;text-align:left}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot)>tr>:is(.report-card-title,.operations-card-title){display:flex;align-items:center;min-height:44px;padding:0 52px 8px 0;font-size:17px;font-weight:700;text-align:left}
 .bm-app table[data-ui-card].ui-auto-card-mode :is(.report-card-title,.operations-card-title)::before{display:none}
 .bm-app table[data-ui-card].ui-auto-card-mode>:is(tbody,tfoot)>tr>:is(.report-card-actions,.operations-card-actions){position:absolute;top:12px;right:12px;display:block;width:44px!important;min-width:0;padding:0}
 .bm-app table[data-ui-card].ui-auto-card-mode :is(.report-card-actions,.operations-card-actions)::before{display:none}
 .bm-app table[data-ui-card].ui-auto-card-mode .ui-mini-menu{border:0;margin:0;padding:0}
 .bm-app table[data-ui-card].ui-auto-card-mode .ui-mini-menu>summary{box-sizing:border-box;min-height:44px;width:44px;margin:0;padding:4px 0}
 .bm-app table[data-ui-card].ui-auto-card-mode .report-number{white-space:nowrap!important;font-variant-numeric:tabular-nums}
 .bm-app table[data-ui-card].ui-auto-card-mode .report-stack-extra{display:none}
 .bm-app table[data-ui-card].ui-auto-card-mode .report-total>td:last-child:empty{display:none}
 .bm-app .ui-scroll-hint{margin:8px 0;padding:0 12px;color:var(--ui-muted);font-size:13px;line-height:1.5}
 .bm-app .ui-scroll-hint[hidden]{display:none}
 .bm-app .ui-identity-scroll tbody>:is(tr)>:is(th,td):first-child,
 .bm-app .ui-identity-scroll tfoot>:is(tr)>:is(th,td):first-child,
 .bm-app .ui-identity-scroll thead tr>th:first-child{position:sticky;left:0;z-index:2;background:var(--ui-surface,#fff);box-shadow:2px 0 0 var(--ui-line)}
 .bm-app .ui-identity-scroll thead tr>th:first-child{z-index:3;background:var(--ui-primary-soft)}
}
@media screen and (max-width:600px){
 .bm-app .rent-target-summary{gap:6px 12px;padding:12px}
 .bm-app .rent-target-summary strong{flex-basis:100%}
 .bm-app .rent-target-summary>span:last-child{font-size:13px}
}
