#team-open {
  border: 1px solid var(--line);
  background: var(--p2);
  color: var(--t);
  border-radius: 7px;
  padding: 5px 12px;
  font: 600 13px/1.5 -apple-system, system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  -webkit-app-region: no-drag;
}
#team-open:disabled { opacity: .5; cursor: default; }
#team-open:hover:enabled { background: var(--p); }

#team-hub {
  --inset: 26px;
  --sheet: #202120;
  --control: #2a2b29;
  --sheet-rule: #3b3d38;
  --sheet-meta: #b2b2a8;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  box-sizing: border-box;
  width: min(720px, 94vw);
  max-height: min(86dvh, 850px);
  padding: 0;
  color: var(--t);
  background: var(--sheet);
  border: 1px solid var(--sheet-rule);
  border-radius: 16px;
  box-shadow: 0 18px 64px #0003;
  font: inherit;
  overflow: hidden;
}
@media (prefers-color-scheme: light) {
  #team-hub { --sheet: #fbfaf6; --control: #f0efe9; --sheet-rule: #ddded5; --sheet-meta: #64655c; }
}
#team-hub[open] { display: flex; flex-direction: column; }
#team-hub::backdrop { background: #12151f52; backdrop-filter: blur(2px); }
#team-hub button { font: inherit; cursor: pointer; }
#team-hub .team-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 7px;
  padding: 24px var(--inset) 16px;
}
#team-hub .team-top h2 { grid-area: 1 / 1 / 2 / 3; margin: 0; font: 400 36px/1.04 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
#team-hub .team-top h2:focus { outline: none; }
#team-hub .team-top :is([data-room], small) { margin-top: 7px; color: var(--sheet-meta); font: 11.5px/1.4 var(--mono); }
#team-hub .team-top [data-room] { grid-area: 2 / 1; max-width: 54vw; overflow-wrap: anywhere; }
#team-hub .team-top small { grid-area: 2 / 2; }
#team-hub .team-top small::before { content: "· "; }
#team-hub [data-dismiss] {
  grid-area: 1 / 3 / 3 / 4;
  align-self: start;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--t2);
  font-size: 23px;
  line-height: 1;
}
#team-hub [data-dismiss]:hover { background: var(--p); color: var(--t); }
#team-hub > nav { display: flex; flex-shrink: 0; gap: 22px; padding: 0 var(--inset); border-bottom: 1px solid var(--sheet-rule); }
#team-hub [data-section] {
  margin-bottom: -1px;
  padding: 11px 1px;
  color: var(--t2);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 550;
}
#team-hub [data-section]:hover { color: var(--t); }
#team-hub [data-section][aria-pressed=true] { color: var(--t); border-bottom-color: var(--t); }
#team-hub [data-error], #team-hub [data-access] { margin: 12px var(--inset) 0; font-size: 13px; }
#team-hub [data-error] { color: var(--kill); }
#team-hub [data-access] { color: var(--t2); }
#team-hub :is([data-access], [data-error]):empty { display: none; }
#team-hub [data-pane] { overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 18px var(--inset) 24px; }
#team-hub [data-pane] h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -.02em; }
#team-hub [data-pane] h3 { font-size: 17px; line-height: 1.35; }
#team-hub [data-pane] p { overflow-wrap: anywhere; }
#team-hub [data-pane] :is(label, summary) { color: var(--t2); }
#team-hub [data-pane] summary { cursor: pointer; font-size: 14px; font-weight: 550; }
#team-hub [data-pane] :is(input, textarea, select) { width: 100%; max-width: 100%; padding: 8px 10px; color: var(--t); background: var(--p2); border: 1px solid var(--line); border-radius: 7px; font: inherit; }
#team-hub [data-pane] textarea { resize: vertical; }
#team-hub [data-pane] button:where(:not(.rw-row)) { padding: 7px 12px; color: var(--t); background: var(--p2); border: 1px solid var(--line); border-radius: 7px; font-size: 13px; line-height: 1.4; }
#team-hub [data-pane] button:where(:not([type=submit])):hover:enabled { background: var(--p); }
#team-hub [data-pane] button[type=submit] { background: var(--t); color: var(--bg); font-weight: 600; }
#team-hub [data-pane] button:disabled { opacity: .55; cursor: default; }
#team-hub :focus-visible, #team-open:focus-visible { outline: 2px solid var(--acct); outline-offset: 2px; }
#team-hub .hub-form { display: grid; gap: 10px; min-width: 0; }
#team-hub .hub-form label { display: grid; gap: 4px; font-size: 14px; }
#team-hub .hub-form button, #team-hub .hub-card button { justify-self: start; }
#team-hub .hub-form details[open] > summary { margin-bottom: 10px; }
#team-hub .hub-card { border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
#team-hub .hub-card :is(h3, h4, p) { margin: 5px 0; white-space: pre-wrap; }
#team-hub [role=status]:empty { margin: 0; }

.rw { display: grid; min-width: 0; gap: 14px; }
.rw :is(section, form, details) { position: static; display: block; overflow: visible; min-width: 0; }
.rw :is(h3, p) { margin: 0; }
.rw :is(small, .rw-muted) { color: var(--t2); }
.rw-toolbar { display: grid; align-items: start; }
.rw-toolbar > * { grid-area: 1 / 1; }
.rw-modes { display: inline-flex; justify-self: start; gap: 2px; border: 1px solid var(--sheet-rule); border-radius: 8px; padding: 2px; background: var(--control); position: relative; z-index: 1; }
#team-hub .rw-modes button { color: var(--t2); background: transparent; border: 0; padding: 4px 10px; border-radius: 5px; font-weight: 550; }
#team-hub .rw-modes button[aria-pressed=true] { color: var(--t); background: var(--sheet); box-shadow: 0 1px 3px #0002; }
#team-hub .rw-toolbar summary { display: flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; min-height: 32px; margin-inline-start: auto; padding: 5px 11px; border-radius: 7px; background: var(--t); color: var(--bg); font-size: 13px; list-style: none; }
.rw-toolbar summary::-webkit-details-marker { display: none; }
.rw-toolbar summary::before { content: ""; width: 10px; height: 10px; background: linear-gradient(currentColor, currentColor) center / 10px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 10px no-repeat; }
.rw-toolbar details[open] summary::before { transform: rotate(45deg); }
.rw-toolbar details[open] form { padding-top: 8px; }
.rw .rw-field { display: grid; gap: 4px; margin: 9px 0; font-size: 13px; }
.rw textarea { min-height: 56px; }
.rw .rw-list, .rw .rw-map { border-top: 1px solid var(--sheet-rule); }
.rw .rw-row {
  position: relative;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 8px;
  column-gap: 10px;
  row-gap: 3px;
  align-items: start;
  width: calc(100% - var(--indent));
  margin-inline-start: var(--indent);
  padding: 16px 5px;
  border: 0;
  border-bottom: 1px solid var(--sheet-rule);
  background: transparent;
  text-align: start;
  overflow-wrap: anywhere;
  color: var(--t);
}
#team-hub .rw-row[aria-current=true] { background: var(--accs); }
.rw-row::after { content: ""; grid-area: 1 / 3; align-self: center; width: 5px; height: 5px; transform: rotate(-45deg); border-right: 1.5px solid var(--t3); border-bottom: 1.5px solid var(--t3); }
.rw-nested::before { content: ""; position: absolute; inset-inline-start: -4px; top: 0; height: 25px; width: 10px; border-inline-start: 1px solid var(--sheet-meta); border-bottom: 1px solid var(--sheet-meta); border-end-start-radius: 4px; opacity: .55; }
.rw-branch-parent .rw-glyph::before { content: ""; position: absolute; inset-inline-start: 12px; top: 37px; bottom: -1px; border-inline-start: 1px solid var(--sheet-meta); opacity: .55; }
.rw .rw-title { grid-column: 2; font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: -.015em; }
.rw-glyph { grid-area: 1 / 1; width: 14px; height: 14px; margin-top: 3px; border: 1.6px solid currentColor; border-radius: 50%; color: var(--t2); }
.rw-row[data-state=waiting] .rw-glyph { color: var(--stake); background: linear-gradient(currentColor, currentColor) center / 6px 1.5px no-repeat; }
.rw-row[data-state=proposed] .rw-glyph { color: var(--ack); border-style: dashed; }
.rw-row[data-state=working] .rw-glyph { color: var(--acct); background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.rw-row[data-state=done] .rw-glyph { color: var(--ans); }
.rw-row[data-state=done] .rw-glyph::after { content: ""; display: block; width: 6px; height: 3px; margin: 2px auto; border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg); }
.rw-meta, .rw-blocker { grid-column: 2; font-size: 12px; line-height: 1.55; }
.rw .rw-meta { color: var(--sheet-meta); }
.rw-meta .rw-owner { font: 11.5px/1.55 var(--mono); }
.rw-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; }
.rw-meta span + span::before { content: "· "; }
.rw .rw-actions, .rw .rw-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rw .rw-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.rw .rw-detail, .rw .rw-decision { display: grid; gap: 10px; }
.rw .rw-detail { padding-top: 2px; }
.rw .rw-decision button { text-align: start; }
.rw .rw-muted { padding-block: 12px; font-size: 14px; }

@media (max-width: 900px) { #team-open { margin-left: auto; } }
@media (max-width: 560px) {
  #team-hub { --inset: 18px; width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  #team-hub .team-top { padding-top: 18px; padding-bottom: 8px; }
  #team-hub [data-dismiss] { height: 44px; width: 44px; }
  #team-hub > nav { gap: 0; justify-content: space-between; }
  #team-hub [data-section] { min-height: 44px; padding-inline: 5px; }
  #team-hub [data-pane] { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  #team-hub [data-pane] :is(input, textarea, select) { font-size: 16px; }
  #team-hub .rw-modes button { min-height: 40px; }
  #team-hub .rw-toolbar summary { min-height: 46px; }
}

@media (prefers-reduced-motion: no-preference) {
  #team-hub[open] { animation: team-appear 180ms cubic-bezier(.22,.72,.2,1); }
  #team-hub[open]::backdrop { animation: team-dim 160ms ease-out; }
  @keyframes team-appear { from { opacity: 0; transform: translateY(9px); } }
  @keyframes team-dim { from { opacity: 0; } }
}
