/* Assistant Teams workspace, sidebar, master-detail views, and in-context modals. */
.team-control { padding: 18px 20px; overflow: auto; min-width: 0; }
.team-context-label { display: flex; gap: 8px; align-items: center; padding: 6px 14px; }
.team-context-label select { max-width: min(100%, 340px); min-height: 40px; }
.team-settings-area { border-top: 1px solid var(--line); margin-top: 16px; }
.team-muted { color: var(--muted); font-size: 13px; margin: 2px 0; }
.team-error-inline { color: var(--danger); font-size: 13px; margin: 6px 0; }
.team-gone { padding: 0 22px; }
.team-status-inline { color: var(--accent); font-size: 13px; margin: 6px 0; }
.team-section-eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; margin: 12px 0 6px; }
.team-section-title { margin: 16px 0 8px; font-size: 15px; font-weight: 650; }
.team-inline-code { padding: 1px 6px; border-radius: 6px; background: var(--field); font-size: 12.5px; font-family: var(--mono, monospace); }
.team-inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }

/* First-class Teams section in desktop sidebar */
.team-sidebar-section { display: none; }
.team-sidebar-head.ws-section-toggle { justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.team-sidebar-list { display: flex; flex-direction: column; gap: 3px; }
.team-sidebar-head[aria-expanded="false"] ~ :is(.team-sidebar-list, .team-sidebar-new) { display: none; }
.team-sidebar-empty { margin: 4px 8px; font-size: 12px; color: var(--muted); }
.team-sidebar-pill {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.team-sidebar-pill:hover { background: color-mix(in srgb, var(--paper-raised) 65%, transparent); }
.team-sidebar-pill.active { background: var(--panel); box-shadow: var(--shadow-soft); }
.team-sidebar-copy { display: flex; flex-direction: column; min-width: 0; }
.team-sidebar-copy strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-sidebar-copy small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-sidebar-new { margin-top: 4px; justify-content: flex-start; font-size: 12.5px; color: var(--accent); border-radius: 10px; }

.team-live-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); opacity: 0.7; }
.team-live-dot.working { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* Persistent 4-tab bar inside Team Workspace */
.team-workspace-tabs {
  display: flex; align-items: center; gap: 6px; padding: 10px 18px 0; border-bottom: 1px solid var(--line);
  background: var(--panel); flex: none; overflow-x: auto;
}
.team-workspace-tabs[hidden] { display: none; }
.team-ws-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 0; border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); font: 600 13.5px/1.2 var(--sans); cursor: pointer; white-space: nowrap;
}
.team-ws-tab:hover { color: var(--text); }
.team-ws-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.team-tab-badge { padding: 1px 7px; border-radius: 999px; font-size: 11.5px; background: var(--field); color: var(--muted); }
.team-tab-badge.is-live { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.team-back-btn { margin-left: auto; font-size: 12.5px; }

/* Master-detail layout (Members & Work, Memory CRUD) */
.team-split { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: 18px; align-items: start; }
.team-rail { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.team-rail-hint { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.team-member-item {
  display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--field); color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.team-member-item:hover { border-color: var(--line-strong); }
.team-member-item.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.team-member-item-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.team-member-item-top code { font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--panel); }
.team-working-line { color: var(--accent); font-size: 12px; }

.team-detail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.team-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.team-detail-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-detail-title-row h2 { margin: 0; font-size: 20px; }
.team-detail-section { display: flex; flex-direction: column; gap: 8px; }
.team-empty-box { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 13px; }

/* Cards, pills, activity & delegation chain */
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.team-card, .team-record, .team-work-card, .team-proposal-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); overflow-wrap: anywhere; min-width: 0;
}
.team-work-card.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.team-proposal-card { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.team-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.team-row-meta, .team-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-short-id { font-size: 12px; color: var(--muted); }
.team-work-prompt { margin: 6px 0; font-weight: 500; }

.team-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--field); color: var(--muted); }
.team-pill.state-done, .team-pill.state-completed, .team-pill.state-applied { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.team-pill.state-running, .team-pill.state-queued, .team-pill.state-accepted { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.team-pill.state-stopped, .team-pill.state-failed, .team-pill.state-needs_you, .team-pill.state-waiting_for_human { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

.team-memory-read { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; }

/* Forms & controls */
.team-field { display: flex; flex-direction: column; gap: 5px; margin: 6px 0; }
.team-field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.team-field input, .team-field textarea, .team-field select { min-width: 0; width: 100%; }
.team-field textarea { min-height: 110px; font-family: inherit; }
.team-inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.team-inline-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.team-settings { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.team-settings-stack { display: flex; flex-direction: column; gap: 14px; max-width: 780px; }
.team-check-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.team-check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.team-check-row input[type="checkbox"] { width: auto; flex: none; margin: 0; }
.team-check-copy { display: flex; flex-direction: column; min-width: 0; }
.team-skill-list { max-height: min(320px, 40dvh); overflow-y: auto; margin: 0; padding-right: 6px; }
.team-skill-list .team-check-row { flex: none; align-items: flex-start; }
.team-skill-list .team-check-row[hidden] { display: none; }
.team-skill-list .team-check-copy small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.team-conn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); flex-wrap: wrap; }
.team-conn-list { display: flex; flex-direction: column; gap: 8px; }
.team-roster-manage, .team-changes-details { margin-top: 16px; }
.team-learning-line { margin-top: 14px; }
.team-telegram svg { display: block; width: 220px; max-width: 100%; }
.team-telegram-listening { display: grid; gap: 8px; margin: 12px 0; padding: 0; border: 0; }
.team-telegram-listening legend { margin-bottom: 4px; font-weight: 600; }
.team-telegram-listening-option { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.team-telegram-listening-option input { flex: none; width: auto; min-height: 0; margin-top: 3px; }
.team-telegram-listening-option span { display: grid; gap: 2px; }
.team-telegram-listening-option small { color: var(--muted); }
.team-new-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

/* In-context modals (Execution Detail, Service Connections, 4-Step Chief Wizard) */
.team-modal-dialog {
  width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / 45%);
}
.team-modal-dialog::backdrop { background: rgb(0 0 0 / 55%); backdrop-filter: blur(2px); }
.team-modal-card { display: flex; flex-direction: column; max-height: calc(100dvh - 44px); }
.team-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.team-modal-titles h2 { margin: 0; font-size: 19px; }
.team-modal-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.team-modal-body { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.team-modal-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.team-modal-tab { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.team-modal-tab.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.team-conn-section, .team-conn-form { display: flex; flex-direction: column; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.team-conn-section h3, .team-conn-form h3 { margin: 0; font-size: 14px; }
.team-conn-content { display: flex; flex-direction: column; gap: 12px; }
.team-conn-picker-head { font-size: 14px; }
.team-conn-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.team-conn-method-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--text); text-align: left; cursor: pointer; }
.team-conn-method-card strong { font-size: 13.5px; }
.team-conn-method-card small { font-size: 12px; line-height: 1.4; }
.team-conn-method-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.team-browser-login-dialog { width: min(1140px, calc(100vw - 24px)); }
.team-browser-login-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 13px; }
.team-browser-viewer-host { min-height: 540px; height: 64dvh; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.team-browser-viewer-host .browser-viewer { flex: 1; min-height: 0; }
.team-preset-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Execution trace steps */
.team-trace-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-trace-section h3 { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.team-trace-pre { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; max-height: 280px; overflow: auto; }
.team-trace-steps { display: flex; flex-direction: column; gap: 8px; }
.team-trace-step { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); }
.team-trace-step.is-error { border-color: var(--danger); }
.team-trace-step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.team-trace-idx { color: var(--muted); font-size: 12px; font-weight: 700; }
.team-trace-tool { font-weight: 700; color: var(--accent); }
.team-trace-target { color: var(--text); font-size: 12.5px; overflow-wrap: anywhere; }
.team-trace-dur { margin-left: auto; color: var(--muted); font-size: 12px; }

/* 4-Step Chief Wizard */
.team-proposal-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.team-proposal-change-row { padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); font-size: 13.5px; line-height: 1.45; color: var(--text); }
.team-wizard-secondary-btn { border: 1px solid var(--line-strong); }
.team-answer-markdown, .team-trace-markdown { overflow-x: auto; overflow-wrap: anywhere; }
.team-answer-markdown, .team-trace-markdown { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); margin-top: 6px; font-size: 13.5px; line-height: 1.55; }
.team-answer-markdown > :first-child, .team-trace-markdown > :first-child { margin-top: 0; }
.team-answer-markdown > :last-child, .team-trace-markdown > :last-child { margin-bottom: 0; }
.team-answer-markdown table, .team-trace-markdown table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 10px 0; }
.team-answer-markdown th, .team-answer-markdown td, .team-trace-markdown th, .team-trace-markdown td { padding: 6px 9px; border: 1px solid var(--line); text-align: left; }
.team-answer-markdown th, .team-trace-markdown th { background: var(--panel); font-weight: 650; }

.team-access-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.team-access-fields { display: grid; gap: 8px; margin: 8px 0; }
.team-access-done { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.team-direct-links { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.team-link-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2, rgba(255,255,255,.02)); }
.team-link-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-link-url { font-size: 12px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.team-phone-entry, .team-phone-context { display: none; }
@media (max-width: 1023px) {
  body.view-control.team-context-active:is(.team-phone-live, .team-phone-settings) #controlViews { display: flex; position: absolute; inset: 0; z-index: 6; background: var(--panel); }
  .control-chat-head:has(.team-phone-entry) { flex-wrap: wrap; }
  .control-chat-head .team-phone-entry { display: inline-flex; flex: 0 0 100%; width: fit-content; font-size: 12px; }
  body:is(.control-phone-view, .team-phone-live, .team-phone-settings) #controlViews > .team-phone-context { display: flex; flex: none; align-items: center; padding: 6px 12px; gap: 8px; }
  .team-phone-context select { flex: 1; min-width: 0; min-height: 40px; }
}
@media (max-width: 820px) {
  .team-split, .team-conn-methods { grid-template-columns: minmax(0, 1fr); }
  .team-link-row { flex-direction: column; align-items: stretch; }
}
.team-sidebar-new[aria-busy="true"]::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: team-creating-spin .8s linear infinite; }
@keyframes team-creating-spin { to { transform: rotate(360deg); } }

/* Team chat: messages scroll, the reply box stays under them, the team panel sits beside both. */
.team-control[data-testid="team-live-view"] { padding: 0; overflow: hidden; }
.team-work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr); }
.team-thread-column { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.team-thread { flex: 1; min-height: 0; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.team-thread > *, .team-work-form > * { width: 100%; max-width: 720px; margin-inline: auto; }
.team-thread > * { flex: none; }
.team-thread > :empty, .team-thread > [hidden] { display: none; }
.team-work-list, .team-work-proposals, .team-work-access, .team-work-automations { display: flex; flex-direction: column; gap: 14px; }
.team-turn { display: flex; flex-direction: column; gap: 8px; }
.team-turn > p { margin: 0; }
.team-turn-error { color: var(--amber); font-size: 13.5px; overflow-wrap: anywhere; }
.team-msg { max-width: 82%; overflow-wrap: anywhere; line-height: 1.55; }
.team-msg-me { align-self: flex-end; white-space: pre-wrap; padding: 9px 14px; border-radius: 16px 16px 4px 16px; background: color-mix(in srgb, var(--accent) 16%, var(--field)); }
.team-msg-reply { align-self: flex-start; }
.team-msg-reply .markdown > :first-child { margin-top: 0; }
.team-msg-reply .markdown > :last-child { margin-bottom: 0; }
.team-msg-who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.team-turn-actions { display: flex; gap: 12px; }
.team-turn-actions:empty { display: none; }
.team-msg-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.team-msg-time-me { align-self: flex-end; margin-top: -4px; }
.team-turn-link { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.team-spinner { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: team-creating-spin .8s linear infinite; }
.team-work-form { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.team-work-form > select[hidden] { display: none; }
.team-work-form > select { width: fit-content; max-width: 100%; margin-inline: max(0px, calc((100% - 720px) / 2)) auto; padding: 3px 28px 3px 10px; min-height: 0; font-size: 13px; color: var(--muted); }
.team-send-row { display: flex; align-items: flex-end; gap: 8px; }
.team-send-row textarea { min-width: 0; overflow-x: hidden; }
.team-side { grid-column: 2; grid-row: 1; min-height: 0; overflow: auto; border-left: 1px solid var(--line); padding: 16px; }
.team-side-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; cursor: pointer; font-weight: 650; list-style: none; }
.team-side-body { display: flex; flex-direction: column; margin-top: 10px; }
.team-side-section { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 6px; border-top: 1px solid var(--line); }
.team-side-section:first-child { border-top: 0; padding-top: 2px; }
.team-side-heading { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.team-side-member { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 0; overflow-wrap: anywhere; }
.team-side-member-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.team-side-ok { font-size: 13px; color: var(--accent); }
.team-side-need { padding: 0; border: 0; background: none; color: var(--amber); font-size: 13px; text-align: left; cursor: pointer; }
@media (max-width: 1100px) {
  .team-work { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .team-side { grid-column: 1; grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; max-height: 45dvh; }
  .team-thread-column { grid-row: 2; }
  .team-thread { padding: 12px; }
  .team-work-form { padding: 8px 12px; }
}
.team-turn-conversation { align-self: flex-start; padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.team-side-conversation { max-width: calc(100% + 16px); padding: 4px 8px; margin: 0 -8px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-side-conversation:hover { background: var(--field); }
.team-side-conversation.is-on { background: var(--field); color: var(--accent); font-weight: 650; }
.team-reply-to { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.team-reply-to[hidden] { display: none; }
.team-reply-to button { padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; text-decoration: underline; cursor: pointer; }
.team-which .team-row-actions { flex-wrap: wrap; }

/* The Teams page (/teams, public/app/teams-view.js): the team list and the chosen team's chat, nothing else. */
body.teams-view .team-back-btn { display: none; }
body.bob-desk.teams-view .ws-side > :not(.ws-brand, .team-sidebar-section), body.bob-desk.teams-view .ws-groups { display: none !important; }
body.teams-view .team-sidebar-head { pointer-events: none; }
body.teams-view .team-sidebar-head::before, body.teams-view .team-sidebar-head::after { display: none; }
body.bob-desk.teams-view .ws-brand > :not(.ws-home-button) { display: none; }
body.bob-desk.teams-view .ws-side > .team-sidebar-section { display: flex; border-top: 0; flex: 1; overflow: auto; }
body.bob-desk.teams-view.projects-collapsed .ws-side > .team-sidebar-section { display: flex; }
@media (max-width: 700px) {
  body.teams-view:not(.team-context-active) .team-sidebar-section {
    display: flex; flex-direction: column; gap: 6px; position: fixed; inset: 0; z-index: 30; overflow: auto;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 24px; background: var(--paper, var(--panel));
  }
  body.teams-view:not(.team-context-active) .team-sidebar-head { font: 400 26px/1.15 var(--serif); letter-spacing: 0; text-transform: none; color: var(--heading); pointer-events: none; }
  body.teams-view:not(.team-context-active) .team-sidebar-head[aria-expanded="false"] ~ .team-sidebar-list { display: flex; }
  body.teams-view .team-sidebar-pill { padding: 12px; }
  body.teams-view .team-sidebar-copy strong { font-size: 15.5px; }
  body.teams-view .team-sidebar-copy small { font-size: 12.5px; }
}

/* A member's browser waiting for the person to sign in or enter a code (control-team-work.js renderSignIns). */
.team-signin-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.team-signin-live { width: 100%; }
.team-signin-live:empty { display: none; }

/* Memory storage: the place picker, backups, short-term notes and the New team wizard. */
.team-store-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 10px; }
.team-store-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--text); cursor: pointer; }
.team-store-card small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.team-store-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.team-store-fields { display: flex; flex-direction: column; gap: 4px; }
.team-backups { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.team-backups > button { align-self: flex-start; }
.team-short-term { margin-bottom: 14px; }
.team-short-term-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.team-short-term .team-inline-bar input { flex: 1; min-width: 0; }
.team-member-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.team-member-chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--text); font-size: 12.5px; cursor: pointer; }
.team-member-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.team-memory-search { width: 100%; margin: 6px 0 10px; }
.team-memory-folder { margin: 8px 0 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.team-wizard-steps { display: flex; gap: 14px; list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.team-wizard-steps li.now { color: var(--accent); font-weight: 650; }
.team-wizard-steps li.done { color: var(--text); }
.team-wizard-body { min-height: 180px; }
.team-wizard-footer { justify-content: flex-end; align-items: center; margin-top: 14px; }
.team-wizard-footer > span { margin-right: auto; }
/* A team's own page has no app tabs underneath: the team is the whole page. */
body.teams-view #phoneTabs { display: none !important; }
body.focus-ui.teams-view:is(.view-projects, .view-sessions, .view-control) .shell { padding-bottom: 0; }
/* An answer that arrived after later messages names the request it answers. */
.team-turn-answers { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Speaking to the team (team-voice.js): the microphone, the line shown while it records, a spoken message and its spoken answer. */
.team-mic, .team-voice-mark::before, .team-phone-place-icon { --icon-mic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10v1a7 7 0 0 0 14 0v-1M12 18v4M8 22h8'/%3E%3C/svg%3E"); }
.team-mic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--field); color: var(--text); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.team-mic::before { content: ""; width: 20px; height: 20px; background: currentColor; mask: var(--icon-mic) center / contain no-repeat; }
.team-send-row.is-recording > .team-mic { border-color: transparent; background: var(--danger); color: #fff; }
.team-send-row.is-recording > .team-mic::before { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5m-6 6 6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.team-recording { display: none; }
.team-send-row.is-recording > .team-recording { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; min-height: 44px; }
.team-send-row.is-recording > :is(textarea, [data-testid="team-work-send"]) { display: none; }
.team-recording-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.team-recording-label { color: var(--muted); font-size: 14px; }
.team-recording-time { font-variant-numeric: tabular-nums; font-weight: 650; }
.team-recording-cancel { margin-left: auto; }
.team-voice-mark { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; color: var(--accent); font-size: 12px; font-weight: 650; }
.team-voice-mark::before { content: ""; width: 13px; height: 13px; background: currentColor; mask: var(--icon-mic) center / contain no-repeat; }
.team-voice-reply { margin-top: 8px; }
.team-voice-reply > p { margin: 0; }
.team-voice-reply audio { display: block; width: min(100%, 340px); height: 40px; }

/* The team's chat moves a little: what is new rises in, the team breathes while it thinks, the microphone pulses while it
   records, and buttons give under a press. Nothing moves with motion off (motion.js: the person's choice, or the device's). */
@keyframes team-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes team-from-right { from { opacity: 0; transform: translateX(18px) scale(.97); } }
@keyframes team-breathe { 50% { opacity: .5; } }
@keyframes team-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
@keyframes team-blink { 50% { opacity: .25; } }
html:is([data-motion="playful"], [data-motion="calm"]) .team-enter { animation: team-rise .42s var(--m-ease) both; }
html:is([data-motion="playful"], [data-motion="calm"]) .team-enter > .team-msg-me { animation: team-from-right .42s var(--m-ease) both; }
html:is([data-motion="playful"], [data-motion="calm"]) .team-thinking { animation: team-breathe 1.8s ease-in-out infinite; }
html:is([data-motion="playful"], [data-motion="calm"]) .team-send-row.is-recording > .team-mic { animation: team-ring 1.2s ease-out infinite; }
html:is([data-motion="playful"], [data-motion="calm"]) .team-recording-dot { animation: team-blink 1s ease-in-out infinite; }
html:is([data-motion="playful"], [data-motion="calm"]) body.teams-view button { transition: transform .18s var(--m-ease), background-color .2s, color .2s, box-shadow .2s; }
html:is([data-motion="playful"], [data-motion="calm"]) body.teams-view button:active:not(:disabled) { transform: scale(.94); transition-duration: .06s; }

/* The phone's bar of places (team-phone-bar.js), shown on the Teams page at phone width only (phone.css). */
.team-phone-bar { display: none; }
.team-phone-heading { margin: 2px 0 14px; font: 400 22px/1.2 var(--serif); color: var(--heading); }
.team-thread-row, .team-phone-hub-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; margin: 0 0 8px; padding: 14px 16px;
  border: 0; border-radius: 16px; background: var(--field); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.team-thread-row strong, .team-phone-hub-row strong { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.team-thread-row small, .team-phone-hub-row small { color: var(--muted); font-size: 14px; }
.team-thread-row.is-on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.team-thread-row.is-on strong { color: var(--accent); }
.team-phone-hub-row { flex-direction: row; align-items: center; justify-content: space-between; }
.team-phone-hub-row::after { content: "›"; flex: none; color: var(--muted); font-size: 24px; line-height: 1; }
.team-phone-hub-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
