/* Team uses the shared shell scale; its documents remain unframed reading surfaces. */
.manager-team { max-width: 1440px; margin: 0 auto; min-width: 0; }
.manager-team * { min-width: 0; }
.manager-team fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.manager-team fieldset:disabled .custom-select { pointer-events: none; opacity: .55; }
.team-tag.is-linked { color: #91c7a2; }
.manager-team button, .manager-team input, .manager-team textarea { font: inherit; letter-spacing: 0; }
.manager-team button { cursor: pointer; }
.manager-team button:disabled { cursor: default; opacity: .45; }
.team-icon { display: block; flex: 0 0 18px; }
.team-tabs { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.team-tabs button { font: inherit; letter-spacing: 0; cursor: pointer; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 8px 12px; min-height: 36px; }
.team-tabs button:focus-visible { outline: 2px solid var(--module-accent); outline-offset: 2px; }
.team-tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px var(--module-accent); }
.team-icon-button { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; }
.team-icon-button:hover, .team-tabs button:hover, .team-text-button:hover { background: var(--surface-2); color: var(--text); }
.manager-team :is(button, a, input, textarea, summary):focus-visible { outline: 2px solid var(--module-accent); outline-offset: 2px; }
.team-search { display: flex; align-items: center; gap: 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; margin-bottom: 16px; max-width: 480px; }
.team-search input { width: 100%; height: 36px; padding: 0; color: var(--text); background: transparent; border: 0; outline: 0; }
.team-search:focus-within { border-color: var(--module-accent); }
.team-search input:focus-visible { outline: none; box-shadow: none; }
.team-search:has(input:focus-visible) { outline: 1px solid var(--module-accent); outline-offset: 0; }
body[data-route="team"] .module-actions { flex-wrap: wrap; max-width: 100%; }
@media(min-width:840px) {
  /* The shared module bar keeps one row; Team only right-aligns its tabs and search. */
  body[data-route="team"] .module-actions { justify-content: flex-end; }
}
.module-actions .team-search { margin: 0; width: 220px; max-width: none; min-width: 0; }
.module-actions .team-search input { min-width: 0; height: 34px; }
.module-actions .team-search .team-icon { width: 18px; height: 18px; }
@media(max-width:1100px) {
  .module-actions .team-search { flex: 1 1 180px; }
}
.team-section-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.team-muted { color: var(--muted); font-size: 12px; }
.team-tag { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.team-process-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,250px),1fr)); gap: 10px; }
.team-process { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface); color: var(--text); }
.team-process:hover { border-color: var(--line-strong); background: var(--surface-2); }
.team-process > b { font-size: 14px; line-height: 21px; font-weight: 600; overflow-wrap: anywhere; }
.team-process > small { font-size: 12px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.team-process-top, .team-process-bottom, .team-role > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-process-top { color: var(--module-accent); }
.team-process-bottom { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); }
.team-process-bottom > span { display: flex; gap: 6px; align-items: center; }
.team-process-bottom svg { width: 15px; height: 15px; flex-basis: 15px; }
.team-detail-heading, .team-document-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.team-detail-heading > div, .team-document-heading > div:first-of-type { flex: 1; overflow-wrap: anywhere; }
.manager-team h2 { font-size: 18px; font-weight: 600; line-height: 26px; margin: 0; }
.manager-team h3 { font-size: 14px; font-weight: 600; line-height: 21px; margin: 0; }
.team-project-facts { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 6px 12px; font-size: 12px; margin: 0 0 20px; }
.team-project-facts dt { margin: 0; font-size: inherit; color: var(--muted); }
.team-project-facts dd { margin: 0; overflow-wrap: anywhere; }
.manager-team .field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.manager-team .field > span { color: var(--muted); font-size: 12px; }
.manager-team textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; color: var(--text); resize: vertical; width: 100%; line-height: 1.5; }
.team-agent-grid, .team-role-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.team-catalog-section { margin: 0 0 24px; }
.team-catalog-section + .team-catalog-section { padding-top: 20px; border-top: 1px solid var(--border); }
.team-catalog-section > h2 { margin: 0 0 12px; font-size: 16px; }
.team-agent { padding: 8px 0; border-block: 1px solid var(--line); }
.team-agent header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.team-agent header .team-tag { margin-left: auto; }
.team-agent-symbol { color: var(--module-accent); }
.team-agent p, .team-role p { font-size: 13px; line-height: 20px; color: var(--muted); margin: 10px 0 16px; }
.team-agent-actions, .team-document-actions { display: flex; align-items: center; gap: 8px; }
.team-agent-actions { gap: 2px; margin-left: auto; }
.team-workers { display: grid; gap: 4px; margin: 8px 0; }
.team-worker { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.team-worker > span { flex: 1; overflow-wrap: anywhere; }
.team-worker b { display: block; font-size: 13px; font-weight: 500; }
.team-worker small { display: block; font-size: 11px; line-height: 17px; color: var(--muted); overflow-wrap: anywhere; }
.team-text-button { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 6px 8px; border-radius: 6px; color: var(--text); background: transparent; }
.team-session-id { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 8px; }
.team-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.team-command { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 12px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; }
.team-command:hover:not(:disabled) { border-color: var(--module-accent); }
.team-related { margin-top: 24px; }
.team-related > h3 { margin-bottom: 10px; }
.team-document-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; }
.team-document-row:hover { background: var(--surface); }
.team-document-row > span { flex: 1; overflow-wrap: anywhere; }
.team-document-row b { display: block; font-size: 13px; font-weight: 500; }
.team-document-row small { display: block; font-size: 11px; line-height: 17px; color: var(--muted); margin-top: 3px; }
.team-document-row > svg { color: var(--muted); }
.team-role { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--surface); }
.team-role > header { color: var(--module-accent); margin-bottom: 12px; }
.team-role .team-document-row { border: 0; padding-bottom: 0; }
.team-definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.team-definition-grid input, .team-definition-grid select, .team-definition-meta select { width: 100%; min-height: 36px; padding: 6px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.team-definition-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.team-definition-meta .field { margin: 0; width: 100px; }
.team-definition-section { padding: 16px 0; border-top: 1px solid var(--line); }
.team-definition-section > h3 { margin-bottom: 10px; }
.team-definition-section summary, .team-specialist-editor > summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.team-definition-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; margin: 8px 0; }
.team-specialist-editor { border-bottom: 1px solid var(--line); padding: 4px 0; }
.team-specialist-editor[open] > summary { margin-bottom: 8px; }
.team-definition-facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 16px; font-size: 12px; line-height: 1.5; }
.team-definition-facts dt { color: var(--muted); text-transform: capitalize; }
.team-definition-facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media(max-width:700px) {
  .team-definition-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .team-definition-facts { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .team-definition-facts dd { margin-bottom: 8px; }
}
.team-observed { margin: 0 0 20px; }
.team-agent .field { margin-top: 12px; }
.team-form-footer { justify-content: flex-end; }
.team-observed > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.team-session-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.team-session-row > span { flex: 1; overflow-wrap: anywhere; }
.team-session-row > span { min-width: 0; }
.team-subagents > summary { padding: 12px 0; cursor: pointer; color: var(--muted); }
.team-session-row b { display: block; font-size: 13px; font-weight: 500; }
.team-session-row code { font-size: 11px; color: var(--muted); }
.team-provider { display: inline-block; margin-inline-start: 8px; color: var(--muted); font-size: 12px; }
.team-document-heading small { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; margin-top: 4px; }
.team-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.team-library-heading .team-search { margin: 0; flex: 0 1 300px; }
.team-library-heading p, .team-library-content > header p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 6px 0 0; }
.team-library-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 32px; }
.team-library-nav { display: flex; flex-direction: column; gap: 4px; align-self: start; }
.team-library-nav button { display: flex; gap: 10px; align-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); min-height: 40px; padding: 10px 12px; text-align: left; }
.team-library-nav button span { flex: 1; }
.team-library-nav button small { font-size: 11px; }
.team-library-nav button:hover, .team-library-nav button[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.team-library-nav button[aria-current="page"] > svg { color: var(--module-accent); }
.team-library-content { max-width: 900px; }
.team-library-content > header { margin: 6px 0 16px; }
.team-library .team-document-row { padding: 16px 8px; }
.team-library .team-document-row b { font-size: 14px; }
.team-library .team-document-row small { font-size: 12px; line-height: 1.5; }
.team-document-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.team-document-toolbar > span { font-size: 12px; }
.team-document-modes { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 8px; }
.team-document-modes button { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 5px; padding: 6px 12px; min-height: 32px; color: var(--muted); background: transparent; }
.team-document-modes button[aria-pressed="true"] { color: var(--text); background: var(--surface-2); }
.team-document-layout { display: grid; grid-template-columns: minmax(0,1fr) 200px; gap: 32px; align-items: start; }
.team-document-layout:not(:has(.team-document-outline:not([hidden]))) { grid-template-columns: minmax(0,1fr); }
.team-document-content { min-width: 0; }
.team-document-content .team-markdown > :first-child { margin-top: 0; }
.team-document-content #managerDocumentForm { margin-bottom: 24px; }
.manager-team .field[hidden], .team-document-outline[hidden] { display: none; }
.team-document-outline { position: sticky; top: 16px; border-left: 1px solid var(--line); padding-left: 16px; }
.team-document-outline summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.team-document-outline nav { display: grid; gap: 2px; max-height: 65vh; overflow-y: auto; }
.team-document-outline button { border: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.5; padding: 6px 4px; text-align: left; overflow-wrap: anywhere; border-radius: 4px; }
.team-document-outline button:hover { color: var(--text); background: var(--surface-2); }
.team-document-outline .is-subheading { padding-left: 14px; }
.team-markdown [data-heading-anchor] { scroll-margin-top: 16px; }
@media(max-width:1000px) {
  .team-library-layout { grid-template-columns: 180px minmax(0,1fr); gap: 20px; }
  .team-document-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .team-document-outline { position: static; grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
  .team-document-outline nav { max-height: 160px; }
}
@media(max-width:620px) {
  .team-library-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .team-library-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .team-library-nav button { min-height: 36px; padding: 8px; font-size: 12px; }
  .team-library-nav button small { display: none; }
  .team-library-heading { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 16px; }
  .team-library-heading .team-search { flex-basis: auto; max-width: none; }
  .team-document-toolbar { flex-wrap: wrap; }
}
.team-markdown { max-width: 900px; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.team-markdown h1 { font-size: 23px; line-height: 1.35; margin: 24px 0 16px; }
.team-markdown h2 { font-size: 18px; margin: 24px 0 12px; }
.team-markdown h3 { font-size: 15px; margin: 20px 0 10px; }
.team-markdown p, .team-markdown ul, .team-markdown ol { margin: 12px 0; }
.team-markdown ul, .team-markdown ol { padding-left: 24px; }
.team-markdown a { color: var(--module-accent); text-underline-offset: 3px; }
.team-markdown code { font-size: 12px; background: var(--surface-2); border-radius: 3px; padding: 2px 4px; }
.team-markdown pre { max-width: 100%; overflow: auto; padding: 12px; border-radius: 6px; background: var(--surface); }
.team-markdown pre code { padding: 0; background: transparent; }
.team-markdown table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
.team-markdown th, .team-markdown td { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); }
.team-markdown blockquote { margin: 16px 0; padding: 0 14px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.manager-team textarea.team-editor { min-height: 350px; height: 55vh; font: 12px/1.65 Consolas,monospace; tab-size: 2; }
.team-empty { padding: 36px 12px; color: var(--muted); text-align: center; }
.team-error { border-left: 2px solid #db8c94; padding: 8px 12px; background: var(--surface); margin-bottom: 12px; color: #e6abb1; overflow-wrap: anywhere; }
.manager-team .custom-select summary { height: 36px; }
.manager-team .custom-select .select-menu { min-width: 0; max-height: 240px; }
.manager-team .custom-select .select-menu button b { white-space: normal; overflow-wrap: anywhere; }
@media(max-width:620px) {
  body[data-route="team"] .module-actions { flex: 1 0 100%; }
  body[data-route="team"] .module-actions .team-search { flex: 1 0 100%; width: 100%; }
  .team-tabs { gap: 0; width: 100%; }
  .team-tabs button { flex: 1; padding: 8px 6px; font-size: 12px; }
  .team-agent-grid, .team-role-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .team-document-heading { flex-wrap: wrap; gap: 6px; }
  .team-document-heading > div:first-of-type { flex-basis: calc(100% - 44px); }
  .team-document-actions { margin-left: auto; }
  .team-project-facts { grid-template-columns: 48px minmax(0,1fr); }
  .team-process { padding: 12px; }
  .team-section-meta { font-size: 11px; }
  .team-form-footer { flex-wrap: wrap; }
  .team-form-footer .team-command { margin-left: auto; }
}
.team-git{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0;font-size:12px;line-height:1.5;text-align:left}
.team-git-branch{color:var(--text);overflow-wrap:anywhere;font-family:Consolas,monospace}
.team-git-state{color:var(--muted)}
.team-git-state.is-clean{color:#91c7a2}
.team-git-state.is-pending{color:#dbbe82}
.team-git-state.is-conflict{color:#e99aa6}
.team-memory { min-width: 0; }
.team-preparation { width: 100%; max-width: 560px; min-width: 0; }
.team-setup { width: 100%; max-width: 620px; min-width: 0; }
.team-setup header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-setup fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.team-setup p { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.team-setup-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.team-service-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.team-service-grid label { display: flex; align-items: start; gap: 7px; padding: 10px 6px; border: 1px solid var(--line); min-width: 0; font-size: 13px; }
.team-service-grid input { flex: 0 0 auto; }
.team-service-grid span { min-width: 0; overflow-wrap: anywhere; }
.team-service-grid small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.team-setup .field { display: grid; gap: 6px; margin-block: 12px; }
.team-setup select { width: 100%; min-width: 0; min-height: 36px; }
.team-setup-option { display: flex; align-items: center; gap: 8px; margin-block: 12px; font-size: 13px; }
.team-preparation [data-provision-close] { margin-left: auto; }
.team-preparation .modal-scroll, .team-preparation code { min-width: 0; overflow-wrap: anywhere; }
.team-preparation textarea { width: 100%; min-width: 0; resize: vertical; }
.team-preparation [data-provision-fields] .field { min-width: 0; margin-bottom: 12px; }
.team-memory-toolbar, .team-memory-history { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.team-memory-list { display: grid; gap: 8px; }
.team-memory-list .team-document-row { width: 100%; }
.team-memory-list .team-document-row > .team-tag { flex: 0 0 auto; }
.team-memory-list small { overflow-wrap: anywhere; }
.team-memory-detail, #memoryEditor > fieldset, #memoryDecision > fieldset { display: grid; gap: 16px; min-width: 0; }
.team-memory-detail { max-width: 900px; }
.team-memory-detail h3 { font-size: 14px; margin: 0 0 8px; }
.team-memory-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.team-memory-history { justify-content: flex-start; margin: 0; color: var(--muted); font-size: 12px; }
.team-memory-history .field { width: 120px; }
.manager-team .team-memory-sources { display: grid; gap: 8px; max-height: 220px; overflow: auto; padding: 12px; border: 1px solid var(--line); }
.team-memory-sources legend { padding: 0 4px; font-size: 12px; color: var(--muted); }
.team-memory-sources label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; overflow-wrap: anywhere; }
.team-memory-sources input { flex: 0 0 auto; }
#memoryEditor { max-width: 900px; }
#memoryEditor textarea, #memoryDecision textarea { resize: vertical; min-height: 96px; }
.team-post-family { margin-block: 20px; }
.team-post-family h3, .team-post-row h3, .team-post-row h4 { margin: 0 0 8px; font-size: 15px; }
.team-post-row { padding-block: 16px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.team-post-row p { margin: 4px 0; }
.team-post-row details { margin-top: 12px; font-size: 12px; }
#teamPostsForm { max-width: 920px; }
#teamPostsForm fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
#teamPostsForm .field { display: grid; gap: 6px; margin-top: 12px; min-width: 0; }
#teamPostsForm input:not([type="checkbox"]), #teamPostsForm select { width: 100%; min-width: 0; max-width: 100%; height: 36px; }
.team-post-members { display: grid; gap: 8px; margin-top: 12px; max-height: 280px; overflow: auto; }
.team-post-members label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.team-post-members input { flex: 0 0 auto; }
.team-post-members span { min-width: 0; }
.team-post-members small { display: block; color: var(--muted); font-size: 11px; }
.team-quality { min-width: 0; }
.team-quality-access, .team-quality-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.team-quality-access { justify-content: flex-end; }
.team-quality-toolbar .field { min-width: 140px; flex: 1 1 150px; }
.team-quality select, .team-quality input, .team-quality textarea { width: 100%; min-width: 0; max-width: 100%; }
.team-quality input, .team-quality select { min-height: 36px; }
.team-quality textarea { min-height: 90px; resize: vertical; }
.team-quality-list, .team-quality fieldset { display: grid; gap: 12px; min-width: 0; }
.team-quality fieldset { border: 0; padding: 0; margin: 0; }
.team-quality form, .team-quality-detail { max-width: 900px; min-width: 0; }
.team-quality .field { display: grid; gap: 6px; }
.team-quality-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(260px,100%),1fr)); gap: 16px; margin-bottom: 16px; }
.team-quality-summary section { border-bottom: 1px solid var(--line); padding-block: 12px; min-width: 0; }
.team-quality h2 { font-size: 18px; margin: 12px 0; }
.team-quality h3 { font-size: 14px; margin: 8px 0; }
.team-quality dl { display: grid; grid-template-columns: minmax(90px,1fr) minmax(0,2fr); gap: 6px; font-size: 13px; }
.team-quality dd { margin: 0; }
.team-quality :is(p,small,code,h3,dd,b) { overflow-wrap: anywhere; }
.team-quality-evidence, .team-quality-history { padding-block: 12px; border-bottom: 1px solid var(--line); }
.team-quality-evidence code, .team-quality-history small { display: block; font-size: 12px; }
.team-quality-text { white-space: pre-wrap; }
.team-quality .team-document-row { width: 100%; }
@media (max-width: 480px) { .team-quality .team-document-row { flex-wrap: wrap; } .team-quality .team-tag { margin-left: 28px; } }
.team-installation-roots { overflow-wrap: anywhere; }
.team-installation-roots code { white-space: normal; }
/* Shared hierarchy and scoped Chat use the same canonical Team identities. */
.scope-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scope-controls > .scope-select { flex: 1 1 0; min-width: 0; }
.portal-scope { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1.4 1 0; }
.portal-scope[hidden] { display: none; }
.portal-scope select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.scope-manager { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 20px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.scope-manager button, .scoped-chat button, .portal-scope button { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--surface); font: inherit; }
.portal-scope button { flex: 0 0 28px; padding: 0; }
.scope-manager input, .scope-manager select, .portal-scope select, .scoped-chat select, .scoped-chat textarea, .scope-inline-create input { min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.scope-manager::backdrop { background: #0009; }
.scope-manager header, .scope-manager footer, .scoped-chat > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.scope-manager label, .scoped-chat form > label { display: grid; gap: 6px; margin-block: 12px; }
.scope-manager label[hidden] { display: none; }
.scope-manager input, .scope-manager select, .scoped-chat textarea { width: 100%; box-sizing: border-box; }
.scope-manager .scope-check { display: flex; align-items: center; overflow-wrap: anywhere; }
.scope-manager .scope-check input { width: auto; flex: 0 0 auto; }
.scope-manager fieldset { min-width: 0; max-height: 40dvh; overflow: auto; border: 1px solid var(--line); }
.scoped-chat { padding: 16px; min-width: 0; }
.scoped-messages { max-height: min(48dvh, 600px); overflow: auto; overscroll-behavior: contain; }
.scoped-messages article { padding: 12px; border-bottom: 1px solid var(--line); }
.scoped-messages p { white-space: pre-wrap; overflow-wrap: anywhere; }
.scoped-chat textarea { min-height: 90px; resize: vertical; }
.scoped-chat fieldset { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 620px) { .scope-manager { padding: 12px; } .scoped-chat { padding: 10px; } }
