/* CRP 1.6.14: layout stability after the density layer.
   Compact spacing remains, but child content must never dictate grid widths. */
.two-column,
.group-layout { grid-template-columns:repeat(2,minmax(0,1fr)); }
.two-column > *,
.group-layout > *,
.group-layout > .panel,
.group-layout > div > .panel,
.panel,
.section-heading > *,
.member-grid,
.member-card,
.member-card > div,
.permission-pills,
.task-canvas,
.task-branches,
.branch-stream,
.branch-event,
.branch-card { min-width:0; max-width:100%; }
.group-layout > div { min-width:0; width:100%; }
.member-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:10px; }
.member-card { width:100%; min-width:0; align-items:flex-start; overflow-wrap:anywhere; }
.member-card .avatar { flex:0 0 36px; }
.member-card > div { flex:1 1 0; min-width:0; }
.member-card :is(strong,small) { white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:normal; }
.permission-pills { display:flex; flex-wrap:wrap; gap:5px; }
.permission-pills > span { display:inline-flex; align-items:center; gap:3px; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
/* Picker labels and long names remain readable; dark picker content cannot be light-on-light. */
.multi-picker .person-option :is(strong,small) { white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere; }
html[data-theme="dark"] .signed-in main .multi-picker,
html[data-theme="dark"] .signed-in main .multi-picker .picker-options { background:#171717!important;color:#f5f5f5!important;border-color:#494949!important; }
html[data-theme="dark"] .signed-in main .multi-picker .person-option { color:#f5f5f5!important; }
html[data-theme="dark"] .signed-in main .multi-picker .person-option strong { color:#f5f5f5!important; }
html[data-theme="dark"] .signed-in main .multi-picker .person-option small,
html[data-theme="dark"] .signed-in main .multi-picker .picker-summary { color:#c7ced5!important; }
html[data-theme="dark"] .signed-in main .multi-picker .picker-summary { border-color:#494949!important; }
.hierarchy-summary,.hierarchy-level { min-width:0;max-width:100%; }
.hierarchy-summary :is(strong,small),.hierarchy-level :is(strong,small) { overflow-wrap:anywhere; }
.group-layout .section-heading,.branch-card .section-heading { flex-wrap:wrap;gap:8px; }
.group-layout .compact-row { min-width:0; }
.group-layout .compact-row > div { min-width:0;overflow-wrap:anywhere; }
/* Every Flow node number is present, including second-, third- and deeper-generation children. */
.task-branches .branch-stream { overflow:visible; }
.task-branches .branch-event.flow-update { min-width:0!important;max-width:none;width:var(--flow-width,75%)!important;margin-left:var(--flow-indent,48px)!important; }
.task-branches .branch-event.flow-update>.branch-node { display:grid!important;visibility:visible!important;opacity:1!important;position:absolute;left:-15px!important;top:11px!important;z-index:5;transform:none!important; }
.task-branches .branch-event:not(.flow-update)>.branch-node { display:grid!important;visibility:visible!important;opacity:1!important;z-index:5; }
.task-branches .branch-card { min-width:0;max-width:100%; }
.task-branches .branch-card :is(.event-kind,h3,strong,small,time,p) { overflow-wrap:anywhere; }
.task-branches .branch-card .section-heading > div:first-child { min-width:0;flex:1 1 180px; }
.task-branches .branch-card .event-actions { display:flex;flex:0 1 auto;align-items:center;gap:8px;min-width:0;flex-wrap:wrap; }
.task-branches .branch-card .event-actions time { white-space:normal; }
.task-branches .branch-compose-actions { display:flex;flex-wrap:wrap;align-items:flex-start;min-width:0;gap:8px; }
.task-branches .branch-compose { min-width:0;max-width:100%; }
.task-branches .branch-compose > summary { display:inline-flex;max-width:100%;white-space:normal;overflow-wrap:anywhere; }
.task-branches .branch-compose[open] { flex:1 1 100%;width:100%;max-width:100%; }
.task-branches .branch-update-form,.task-branches .branch-update-form>* { min-width:0;max-width:100%; }
.task-branches .branch-update-form > .update-fields { grid-template-columns:minmax(0,1fr) minmax(75px,105px); }
.task-branches .update-file-row { display:flex!important;flex-wrap:wrap;min-width:0; }
.task-branches .update-file-picker { max-width:100%;min-width:0;flex-wrap:wrap; }
.task-branches .update-file-picker input { min-width:0;max-width:100%; }
.task-branches .update-form-actions { min-width:0;max-width:100%;flex-wrap:wrap; }
.task-branches .cumulative-chain-actions { display:flex;margin:4px 0 10px;min-width:0; }
.task-branches .cumulative-chain-actions > details { min-width:0;max-width:100%; }
.task-branches .cumulative-chain-actions > .branch-compose[open] { width:100%; }
/* The organization tree uses the geometric grid already drawn on <main>. */
.signed-in main .department-tree-panel,
html[data-theme="dark"] .signed-in main .department-tree-panel,
html:not([data-theme="dark"]) .signed-in main .department-tree-panel { background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important;padding:14px 0!important; }
.signed-in main .department-org-viewport { background:transparent!important;max-width:100%; }
.signed-in main .department-org-caption :is(strong,small) { white-space:normal;overflow-wrap:anywhere; }
/* Protect navigation and header labels instead of cropping them. */
.sidebar nav a { min-width:0;overflow-wrap:anywhere; }
.header-actions,.user-menu,.user-profile-link { min-width:0;max-width:100%; }
.user-profile-link > span:last-child { min-width:0;overflow-wrap:anywhere; }
.user-profile-link small { overflow-wrap:anywhere;white-space:normal; }
.task-view-header,.page-heading { min-width:0; }
.task-view-header h1,.page-heading h1 { overflow-wrap:anywhere; }
@media(max-width:1100px) {
 .group-layout { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:800px) {
 .two-column { grid-template-columns:minmax(0,1fr); }
 .signed-in header .user-menu { flex-wrap:wrap; }
 .task-branches { overflow:visible; }
 .task-branches .branch-stream { min-width:0!important;max-width:100%;margin-left:10px;padding-left:36px; }
 .task-branches .branch-event { min-width:0!important; }
 .task-branches .branch-event:not(.flow-update) { width:100%; }
 .task-branches .branch-event.flow-update { min-width:0!important;max-width:100%; }
 .sidebar nav { display:flex;flex-wrap:nowrap;overflow-x:auto;gap:4px; }
 .sidebar nav a { flex:0 0 auto;white-space:nowrap; }
 .sidebar .nav-label { display:none; }
}
@media(max-width:540px) {
 .task-branches .branch-update-form > .update-fields { grid-template-columns:minmax(0,1fr); }
 .task-branches .cumulative-chain-actions { margin-left:0; }
 .member-grid { grid-template-columns:minmax(0,1fr); }
 .section-heading { flex-wrap:wrap; }
}
