/* API adapter necessities only. All visual tokens/components come from source styles.css. */
[hidden]{display:none!important}
[data-license-form] fieldset{border:0;padding:0;margin:0;min-width:0}
a.nav-item,a.side-link,a.rail-button,a.conversation,a.storage-trigger,a.folder-mark{color:inherit;text-decoration:none}
.sidebar .user-trigger>span:not(.avatar){flex:1;min-width:0}
.sidebar .user-trigger>span:not(.avatar)>[data-user-text],.sidebar .user-trigger>span:not(.avatar)>small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.operation-dialog{padding:0;color:var(--ink);margin:auto;position:fixed}
.operation-dialog:not([open]){display:none}
.operation-dialog::backdrop{background:#1a1a1a4d;backdrop-filter:blur(3px)}
.operation-dialog>.modal-content{min-height:0;overflow:auto}
.operation-dialog.with-subtitle>header{height:auto;padding-top:14px;padding-bottom:14px}
.operation-dialog.with-subtitle>header h2{min-width:0;flex:1;overflow-wrap:anywhere}
.operation-dialog.with-subtitle>header>.mono{max-width:40%;overflow-wrap:anywhere}
.operation-dialog.with-subtitle>header>[data-close]{flex-shrink:0}
@media(max-width:760px){
  .operation-dialog.with-subtitle>header{display:grid;grid-template-columns:minmax(0,1fr) 24px;gap:8px 18px;min-height:53px}
  .operation-dialog.with-subtitle>header>.mono{grid-column:1/-1;grid-row:2;max-width:none}
  .operation-dialog.with-subtitle>header>[data-close]{grid-column:2;grid-row:1;align-self:start}
}
.operation-dialog .cx-select-menu{position:fixed}
.operation-dialog .cx-select-list{overflow-y:auto}
.module-body,.module-body>form{display:flex;flex:1;min-height:0;overflow:hidden}
.module-body>form>.modal-split{flex:1}
.group-editor-body,.group-editor-body>form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.group-editor-body .scroll-frame{flex:1;min-height:0}
.group-editor-body .editor-scroll{overflow:auto;max-height:60vh}
.workspace-page{height:100%;min-height:0;display:flex;flex-direction:column;overflow:auto}
.workspace-page>.main-content{flex:1;min-height:0}
.workspace-page>.split-sheet{height:100%;min-height:0}
.workspace-page .split-main{min-height:0}
.workspace-page .node-scroll{overflow:auto}
/* The strip follows the deck: folded, it is only as tall as the folded deck; while the deck is open (hover or a focused
   card) it grows to the open height, so the divider and the body move with it and the cards never cover the body.
   Both heights use the same cap, so opening never makes the strip shorter. */
.node-flow .flow-side:has(.flow-stack){
  --flow-cap:min(180px,22vh);
  --flow-folded:min(calc(var(--fh) + (var(--n) - 1) * var(--peek)),var(--flow-cap));
  --flow-expanded:min(calc(var(--n) * (var(--fh) + 5px)),var(--flow-cap));
  height:calc(22px + var(--flow-folded));
  transition:height .26s cubic-bezier(.22,.61,.36,1);
}
.node-flow .flow-side:has(.flow-stack:is(:hover,:focus-within)){height:calc(22px + var(--flow-expanded))}
@media(prefers-reduced-motion:reduce){.node-flow .flow-side:has(.flow-stack){transition:none}}
.node-flow .flow-stack{
  max-height:var(--flow-cap);
  overflow:clip;
  overscroll-behavior:contain;
}
.node-flow .flow-stack:is(:hover,:focus-within){
  height:var(--flow-expanded);
  overflow-y:auto;
  overflow-x:hidden;
}
.node-flow .flow-stack:focus-within .flow-chip{transform:translateY(calc(var(--i) * (var(--fh) + 5px)))}
.node-flow .flow-stack:focus-within .flow-chip>*{opacity:1}
/* Template editing and publishing must remain reachable when the source hides split-side. */
@media(max-width:760px){
  .template-editor{display:block;overflow:auto}
  .template-editor .split-main{display:block;position:relative}
  .template-editor .main-content{overflow:visible}
  .template-editor .list-body{flex:none;max-height:40vh;min-height:160px}
  .template-editor .split-side{display:flex;width:auto!important;border-left:0;border-top:.5px solid var(--line)}
  .template-editor .side-content{overflow:visible}
  .template-editor .actions{flex-wrap:wrap}
  .template-editor .breadcrumb strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .template-editor .stepper{gap:6px}
  .template-editor .stepper>span{min-width:0;flex:1;font-size:var(--fs-caption);gap:4px}
  .template-editor .stepper b{flex-shrink:0}
  .template-editor .stepper i{width:12px;flex-shrink:0}
  .account-statistics .cols2{grid-template-columns:1fr}
  .account-statistics .metric-grid{grid-template-columns:repeat(2,1fr)}
}
.panel-body{overflow:auto}
.shelf-tools{display:contents}
.shelf-groups{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
.shelf-groups .project-row{overflow-x:auto}
.crumbs a{color:inherit;text-decoration:none}
.main-sheet.r1-graph{background:transparent;border-color:transparent;box-shadow:none;overflow:visible}
.r1-graph .workspace-page{overflow:visible}
.graph-status{position:fixed;top:76px;left:calc(var(--sidebar,220px) + 34px);z-index:30;max-width:600px;color:var(--error,#a33);background:var(--paper);padding:10px}
.graph-node{touch-action:none}
.content-text{white-space:pre-wrap;overflow-wrap:anywhere}
.spec-unit{max-width:80px}
.ib-hint.error,.spec-hint.error{color:var(--error,#a33)}
.mobile-conversations{display:none}
.discussion-conversation>span:nth-child(2){overflow-wrap:anywhere}
.discussion-conversation .conversation-state{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;margin-top:1px}
.discussion-conversation .time,.discussion-conversation .unread-badge{position:static}
.messages-main .chat-context-card small{display:block;margin-top:7px}
.direct-settings .person small{font-family:var(--mono)}
.direct-settings .person+.actions{margin-top:16px}
.messages-project-layout .chat-heading>.person{max-width:calc(100% - 60px)}
@media(min-width:1401px){.messages-project-layout .chat-heading>.person{flex-shrink:0;max-width:45%}}
.messages-project-layout .chat-heading>.person strong{overflow-wrap:anywhere}
.messages-project-layout .chat-heading>.chat-context-link{flex:1;min-width:0;max-height:80px;overflow:auto}
.messages-project-layout .chat-heading>.btn.icon-btn{flex-shrink:0}
.messages-project-layout .chat-context-link .btn.link{max-width:calc(100% - 10px);white-space:normal;overflow-wrap:anywhere;text-align:left}
.messages-project-layout .chat-context-link .btn.link [data-user-text]{min-width:0}
.account-panel .conversation-projects{align-items:flex-start}
.account-panel .conversation-projects>span:first-child{flex-shrink:0}
.account-panel .conversation-projects>span:last-child{min-width:0;flex:1;flex-wrap:wrap;justify-content:flex-end}
.account-panel .conversation-projects .btn.link{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.account-panel .conversation-projects .btn.link [data-user-text]{min-width:0}
.oc-table td>.oc-run{margin-inline-start:8px}
@media(max-width:760px){
  .messages-layout .conversation-column.mobile-show{display:flex!important;width:100%;min-width:0;padding-right:0;border-right:0}
  .conversation-column [data-conversations-close]{align-self:flex-start;margin-bottom:12px}
}
.storage-modal .storage-tabs .selected{color:var(--ink)}
.storage-personal-tags{display:flex;gap:4px 8px;align-items:center;flex-wrap:wrap;margin-top:6px}
.storage-personal-tags .chip{color:var(--muted);background:transparent;padding:0;letter-spacing:0;white-space:normal;overflow-wrap:anywhere}
.storage-personal-tags .text-button,.storage-tag-filters .text-button{font-size:var(--fs-caption);color:var(--muted)}
.storage-tag-filters{max-width:100%;margin-bottom:12px}
.storage-tag-filters .filter{color:var(--muted);background:transparent;white-space:normal;overflow-wrap:anywhere;text-align:left;max-width:100%}
.storage-tag-filters .filter.active{color:var(--ink);background:var(--inset)}
.storage-tag-filters.expanded{max-height:160px;overflow-y:auto}
.storage-modal .storage-row>div{min-width:0}
.storage-modal [data-storage-drag]{user-select:none;-webkit-user-drag:none;touch-action:none}
body.stash-lifting .operation-dialog.storage-modal{opacity:0;pointer-events:none}
.stash-ghost{pointer-events:none;z-index:10000}
@media(max-width:760px){.mobile-conversations{display:inline-flex}.account-tabs{overflow-x:auto;flex-shrink:0}.invite-card{min-width:0;max-width:100%}.spec-unit{max-width:50px}.workspace-page .node-top{flex-wrap:wrap}}

.operation-dialog.storage-modal{margin:0;top:auto;right:auto;bottom:14px;left:calc(var(--left) + 1px);max-width:calc(100vw - var(--left) - 15px)}
@media(max-width:760px){.operation-dialog.storage-modal{left:72px;max-width:calc(100vw - 86px)}}

.storage-modal>footer .pagination{width:100%;margin:0;padding:0;border:0}
.storage-modal #storage-pagination{display:contents}
.storage-modal #storage-pagination>.pagination{flex:1;min-width:220px;width:auto}
/* The source only sizes the version-pill dot. Use that same indicator in history. */
.node-history-link .orange-dot,.hist-row .orange-dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--orange);flex:0 0 auto}
/* Private previews retain the original photo/card containers. */
.graph-node .thumb img{width:100%;height:100%;object-fit:cover}
.image-preview{display:grid;place-items:center;min-height:170px;background:var(--inset)}
.image-preview img{max-width:100%;max-height:60vh;object-fit:contain}
/* User-defined and legacy automatic labels must not push version links out of view. */
.pin-v,.ver-v{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.version-pill [data-version-label]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Native disabled groups preserve original Fork form spacing. Bound the original
   request sheet when real applications exceed the prototype's two mock rows. */
#fork-dialog fieldset{border:0;padding:0;margin:0;min-width:0}
[data-join-requests]{overflow-wrap:anywhere}
.fork-requests[data-join-requests]{max-width:calc(100vw - var(--left) - 20px);max-height:70vh;display:flex;flex-direction:column}
.fork-requests[data-join-requests]>div{overflow:auto;min-height:0}
.fork-requests[data-join-requests]>header,.fork-requests[data-join-requests]>footer{flex-shrink:0}
[data-join-requests].share-section article{padding:16px 0;border-bottom:.5px solid var(--line)}
@media(max-width:760px){.fork-requests[data-join-requests]{left:72px;max-width:calc(100vw - 86px)}}

#internal-action [data-contact-project-fields] { border:0; padding:0; margin:0; min-width:0; }
@media(min-width:761px){#internal-action .modal-split>.modal-aside{padding:24px}}

@media(max-width:760px){#internal-action .modal-split{flex-direction:column;overflow:visible}#internal-action .modal-split>.modal-aside{display:block;width:auto;flex-basis:auto;border-left:0;border-top:.5px solid var(--line);padding:24px}#internal-action .modal-split>section{overflow:visible}}

/* Existing message file card, with user-requested in-thread preview. */
.shared-project.chat-image{display:flex;flex-direction:column;align-items:flex-start;max-width:100%;padding:8px;gap:8px}
.chat-image img{width:240px;max-width:100%;height:160px;object-fit:contain;background:var(--inset);border-radius:3px}
.chat-image span{display:flex;align-items:center;gap:6px;max-width:100%;overflow-wrap:anywhere}
.composer-row.drag-over{outline:1px dashed var(--blue);background:var(--soft)}

.chat-image-draft{gap:10px;align-items:center}.chat-image-draft>img{width:64px;height:48px;object-fit:contain;flex-shrink:0}.chat-image-draft>span{min-width:0;overflow-wrap:anywhere}.chat-image-draft small{display:block}

.asset-file-preview{min-height:170px;margin-top:24px;border:.5px solid var(--line);background:var(--inset);display:grid;place-items:center;padding:22px}
.asset-file-preview img{max-width:100%;max-height:340px;object-fit:contain}
/* Full storage pages retain original tables; wrappers preserve the original flex/scroll boundaries. */
.storage-page [data-storage-results]{display:flex;flex:1;min-height:0;flex-direction:column}
.storage-page [data-storage-pagination]{margin-top:auto;flex-shrink:0}
.storage-page [data-storage-filters]{display:block;margin-bottom:0}
/* BE163: all-files project filters keep the original .filters wrap and scroll inside their own bounded area, so many/long projects cannot squeeze the table and pager out (nodes page keeps block for its nested tag filters). */
.storage-page.storage-file-catalog [data-storage-filters]{display:flex;flex-wrap:wrap;align-content:flex-start;max-height:160px;overflow-y:auto;margin-bottom:12px}
.storage-file-catalog [data-storage-filters] .filter{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
.storage-file-catalog .data-table td[colspan]{text-align:left}
/* BE163 follow-up: on narrow screens the page-button group wraps inside the pager instead of running past the viewport. */
.storage-file-catalog [data-storage-pagination] .pagination>div{flex-wrap:wrap;max-width:100%;min-width:0}
/* BE166: the projects shelf pager grows to fit and wraps its page buttons when they do not fit; wide desktop stays one 48px row. */
.pagination.shelf-pagination{height:auto;min-height:48px;flex-wrap:wrap;row-gap:8px}
.shelf-pagination>#shelf-pages{flex-wrap:wrap;max-width:100%;min-width:0}
/* BE167: disabled license / publication actions look disabled (same tokens as .cx-select.is-disabled); only these buttons. */
.btn.publication-action:disabled{background:var(--inset);border-color:var(--line);color:var(--muted);cursor:not-allowed;box-shadow:none}
.storage-page .toolbar .cx-select{width:140px;flex-shrink:0}
.storage-modal #storage-pagination{flex:1;min-width:0}
@media(max-width:760px){
  .storage-page .toolbar{flex-wrap:wrap}
  .storage-page .toolbar .search{flex-basis:100%}
  .storage-page .pagination{height:auto;min-height:48px;gap:8px;flex-wrap:wrap}
  .storage-page .data-table{min-width:620px}
  .storage-modal>footer{flex-wrap:wrap}
}

.storage-page-note{padding:19px 0;font-size:var(--fs-caption)}
.node-draft-destinations{max-height:240px;overflow:auto}

/* Real comparison groups can outgrow the prototype samples; keep the record table reachable. */
.main-content.run-list{overflow:auto}
.run-list>.list-body{flex:1 0 180px}
.run-list .analysis-band{max-height:30vh;overflow:auto;flex-shrink:0}

/* The split detail pane can be narrow even on desktop; keep the reason action reachable. */
.run-detail .diff-band{flex-wrap:wrap}
.run-detail .db-body{flex-basis:260px}
.run-detail .db-item{max-width:100%;flex-wrap:wrap;overflow-wrap:anywhere}
.run-detail .db-why{flex-wrap:wrap}
.run-detail .db-why p{flex:1 1 160px;min-width:0;overflow-wrap:anywhere}
/* Record panes can be narrow while the page still uses its desktop split layout. */
.run-detail,.run-form{container-type:inline-size}
.run-detail>.actions,.run-detail .section-label{flex-wrap:wrap}
.run-detail .section-label{white-space:normal}
.run-detail .run-number{min-width:0;overflow-wrap:anywhere}
@container(max-width:500px){
  :is(.run-detail,.run-form) .pin-row{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"type name" "v v" "state state" "link link"}
  :is(.run-detail,.run-form) .pin-v,:is(.run-detail,.run-form) .pin-row>.btn,:is(.run-detail,.run-form) .pin-row>.faint:last-child{justify-self:start;max-width:100%}
  :is(.run-detail,.run-form) .pin-state.faint{grid-area:state}
  .run-detail .lf-list.in-form .lf-row{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
  .run-detail .lf-src{grid-column:1/-1;overflow-wrap:anywhere}
  .run-detail .lf-fld{min-width:0;overflow-wrap:anywhere}
  .run-detail .cols3{grid-template-columns:1fr}
  .run-detail .run-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* The original high-contrast palette is light-only; retain readable secondary text in dark mode. */
body.dark.high-contrast { --line:#c0bbb0; --muted:#dedacf; --faint:#c7c2b8; }

/* Keep the real save/sync controls inside the original narrow record form. */
@media(max-width:760px){
  .run-form .form-actions .actions{max-width:100%;flex-wrap:wrap;justify-content:flex-end}
}

.graph-links path.link-preview{pointer-events:none}
.graph-node>.port{z-index:3}

/* Cards show summaries; full records and authored content remain in their detail pages. */
.preview-dots{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.node-ticks>.faint{display:block}
.run-list .summary-strip{flex-wrap:wrap;gap:18px}
.run-list .summary-strip>div{min-width:0;max-width:100%}
.project-card{min-width:0}
.project-card p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}
.project-card .tags{flex-wrap:nowrap;overflow:hidden;flex-shrink:0}
.project-card .chip,.gallery-card .chip{max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis}
.project-card .chip.faint{flex-shrink:0}
.gallery-info h3{overflow-wrap:anywhere}

/* Original statistics cards remain scrollable when the viewport is short. */
.account-statistics{overflow:auto}
.account-statistics .setting-row a{white-space:normal;overflow-wrap:anywhere;text-align:left}
/* Persistent member names can exceed the prototype's short demo labels. */
[data-project-members] .member-group h4 { gap: 4px; }
[data-project-members] [data-fold-members] { min-width: 0; flex: 1; white-space: normal; text-align: left; justify-content: flex-start; }
[data-project-members] [data-fold-members] [data-user-text] { min-width: 0; overflow-wrap: anywhere; }
[data-project-members] [data-group-role] { flex-shrink: 0; }

/* Public details reuse the README heading and author row without card truncation. */
.publication-detail{display:block;overflow:auto}
.publication-detail .node-page-header{padding:24px 0 0}
.publication-detail .node-top{flex-wrap:wrap}
.publication-detail h1,.publication-detail h2,.publication-detail .person,.publication-detail .chip{overflow-wrap:anywhere;min-width:0;max-width:100%}
.publication-detail .chip{white-space:normal}
.publication-detail .publication-heading .tags{margin-top:16px}
.publication-detail .actions{flex-wrap:wrap;margin-top:12px}
.publication-detail .actions .btn{white-space:normal;text-align:left;max-width:100%}
.publication-detail .breadcrumb{height:auto;min-height:44px;flex-wrap:wrap;padding:0}
.publication-detail .publication-readme{margin-top:24px;border-top:.5px solid var(--line)}
.publication-detail .node-block{padding-right:0}
/* BE196: the real nine-count container summary (containerPurgeBody) wraps inside the original dialog instead of squeezing the name into a one-character column and scrolling sideways. Scoped to this list only; font, colour, spacing and width unchanged. */
.confirm-list.container-summary li{flex-wrap:wrap}
.confirm-list.container-summary li>span{min-width:0;overflow-wrap:anywhere}
.confirm-list.container-summary small{white-space:normal;flex-shrink:1;min-width:0}
/* BE207: a long unbroken authored file title wraps inside the node block and the shared file preview (project Files, images, My storage files) instead of stretching them sideways. Only the block title, the preview identity name and the name inside #file-preview; tables keep their own local scroll. */
.node-block>[data-user-text],.file-identity strong,#file-preview p{overflow-wrap:anywhere}
/* 「本实验室」项目列表（只有它带 .lab-shelf-note）：行尾的「只读」按标签宽度不折行，项目名照常换行（MyLab 对齐批次，Root 8e6d7ba1 / 3bc24fd1） */
.list-body:has(>.lab-shelf-note)>.data-table td.row-more .readonly-tag{white-space:nowrap}
/* MB-0019 T-148: the canvas breadcrumb's parent name may wrap inside itself; its separator stays beside the name's last line, never alone on a line of its own. */
.graph-crumb{display:flex;align-items:last baseline;column-gap:.25em}
