/* Shared containment rules, layered after module layouts. */
.main .page-heading>div,.card-title>h2,.notice>div,.notice>p,.notification-copy{min-width:0}
.main .page-heading.with-back.has-page-description{row-gap:8px}
.main .page-heading.with-back>.subtitle,.main .page-heading.with-back>.wide-subtitle{grid-column:1/-1;grid-row:2;margin:0;min-width:0}
.notice>div,.notice>p,.body-text,.caption,.subtitle,.code-block,.rest-record-copy,.setting-copy{overflow-wrap:anywhere}
.card-title{flex-wrap:wrap;row-gap:10px}
.table-wrap{min-width:0;max-width:100%}
.data-table th,.data-table td{white-space:normal;overflow-wrap:anywhere}
.data-table .table-date{white-space:nowrap;font-variant-numeric:tabular-nums}
.schedule-table th:first-child{width:50%}
.data-table .table-actions md-icon-button+md-icon-button{margin-left:8px}
#modal[open]{display:flex;flex-direction:column;overflow:hidden}
#modal .dialog-header,#modal .dialog-actions{position:static;flex-shrink:0}
#modal .dialog-body{min-height:0;overflow:auto;overscroll-behavior:contain}
#modal .dialog-header h2{overflow-wrap:anywhere}
#modal .dialog-actions{gap:12px}
#modal .settings-item:has(md-switch){padding-right:8px}
.actions.mobile-only{gap:8px}
@media(max-width:1023px){
 .responsive-table,.responsive-table tbody{display:block;width:100%}
 .responsive-table thead{display:none}
 .responsive-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;padding:18px 0;border-bottom:1px solid var(--line)}
 .responsive-table tbody tr:last-child{border-bottom:0}
 .responsive-table tbody td{display:block;width:auto;min-width:0;max-width:100%;padding:0;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
 .responsive-table tbody td:before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;font-weight:400;margin-bottom:5px;line-height:1.5}
 .responsive-table tbody td.table-title{grid-column:1/-1;order:-1;font-size:14px;line-height:1.7;font-weight:500}
 .responsive-table tbody td.table-title:before{display:none}
 .responsive-table tbody td.table-date{white-space:nowrap;font-size:12px}
 .responsive-table tbody td.table-actions{grid-column:1/-1;display:flex;align-items:center;gap:8px}
 .responsive-table tbody td.table-actions:before{display:none}
 .responsive-table .table-actions md-icon-button+md-icon-button{margin-left:0}
 .responsive-table .mobile-row-label{display:none}
 .responsive-table tfoot{display:block}
 .responsive-table tfoot tr{display:flex;flex-wrap:wrap;gap:12px}
 .responsive-table tfoot td,.responsive-table tfoot th{border:0;padding:12px 0}
}
@media(max-width:599px){
 .main .page-heading.with-back>.heading-actions{grid-column:1/-1;justify-content:flex-end;margin-top:2px}
 .main .page-heading.with-back.has-page-description>.heading-actions{grid-row:3}
 .page-heading .subtitle{line-height:1.7}
 .dialog-header{padding-top:16px;padding-bottom:12px}
 .dialog-body{padding-bottom:20px}
 .dialog-actions{padding-top:14px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 .rest-empty{padding:36px 20px}
 .main:has(.rest-empty) .page-heading{margin-bottom:24px}
}
@media(orientation:landscape) and (max-height:500px){
 #modal .dialog-header{padding-top:6px;padding-bottom:4px}
 #modal .dialog-body{padding-top:8px;padding-bottom:16px}
 #modal .dialog-actions{padding-top:8px;padding-bottom:8px}
}

/* Membership operations wrap without squeezing their touch targets. */
.bank-actions{flex-wrap:wrap}

/* Import clarification stays inside the existing review step. */
.import-demo-note{margin-bottom:16px;overflow-wrap:anywhere}
.import-clarification{display:grid;gap:14px;padding:20px;margin-bottom:20px;background:var(--md-sys-color-surface-container-low);border:1px solid var(--line);border-radius:16px;min-width:0}
.import-clarification>.row{color:var(--primary);align-items:flex-start}
.import-clarification h3{font-size:15px}
.import-clarification>.caption{overflow-wrap:anywhere}
.import-clarification .actions{gap:12px}
@media(max-width:599px){.import-clarification{padding:16px}.import-clarification .actions>*{flex:1;min-width:0}}
@media(max-width:359px){.import-clarification .actions>*{flex-basis:100%}}

/* Review-only progress controls share the existing spacing scale. */
.progress-period-row,.progress-brief{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:16px 0;color:var(--muted);font-size:12px}
.progress-period-row .chips{margin:0}.progress-brief{margin-top:0;margin-bottom:24px}
.progress-curve-note{margin-top:12px;line-height:1.7}.forecast-dot{background:var(--night-success, #7eafa2)}
.progress-chapter-row{display:grid;width:100%;border:0;background:transparent;text-align:left;color:inherit;font:inherit;cursor:pointer;padding:12px 0}
.offline-banner {grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:14px 16px;margin-bottom:20px;border:1px solid var(--night-outline, #d5e8ed);border-radius:16px;background:var(--night-layer, #edf6f8);font-size:13px;line-height:1.6}
.offline-banner>.icon {flex-shrink:0}
.offline-banner>div {flex:1;min-width:0}
.offline-banner strong {font-weight:500}
.offline-banner p {margin:4px 0 0;color:var(--muted);font-size:12px}
.offline-banner md-text-button {flex-shrink:0}
.offline-empty .empty {display:flex;flex-direction:column;align-items:center;max-width:640px;margin:auto}
.offline-empty .empty>md-outlined-button,.offline-empty .empty>md-filled-button {margin:8px}
@media(max-width:599px){.offline-banner {flex-wrap:wrap;gap:8px}.offline-banner>div {flex-basis:calc(100% - 36px)}.offline-banner md-text-button {margin-left:28px}.offline-empty .empty>md-outlined-button,.offline-empty .empty>md-filled-button {margin:12px auto}}
