.content:has(.crew-page) {
 overflow: hidden;
}

.crew-page {
 --page-title-size: 2rem;
 --page-title-line-height: 1.25;
 --page-title-leading: calc(
  var(--page-title-size) *
   var(--page-title-line-height)
 );
 display: flex;
 flex: 1;
 min-height: 0;
 width: 100%;
 height: 100%;
 background: var(--background);
}

.crew-pane {
 width: 280px;
 flex: 0 0 280px;
 border-right: 1px solid var(--border);
 padding: calc(
   32px + var(--page-title-leading)
  )
  16px 24px;
 overflow: auto;
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.crew-pane-head {
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.crew-pane h1,
.crew-main h1 {
 margin: 0;
 font-size: var(--page-title-size);
 line-height: var(
  --page-title-line-height
 );
 font-weight: 600;
}

.crew-tabs,
.crew-actions,
.crew-room-head {
 display: flex;
 gap: 8px;
 flex-wrap: wrap;
 align-items: center;
}

.crew-room-head {
 justify-content: space-between;
}

.crew-main {
 flex: 1;
 min-width: 0;
 overflow: auto;
 padding: 24px;
 display: flex;
 flex-direction: column;
 gap: 16px;
}

.crew-list-item {
 display: flex;
 flex-direction: column;
 align-items: flex-start;
 gap: 2px;
 width: 100%;
 text-align: left;
 border: 1px solid var(--border);
 background: var(--card);
 color: var(--foreground);
 border-radius: 10px;
 padding: 10px 12px;
 cursor: pointer;
}

.crew-list-item.is-active {
 border-color: var(--foreground);
}

.crew-card {
 border: 1px solid var(--border);
 background: var(--card);
 border-radius: 12px;
 padding: 16px;
 display: flex;
 flex-direction: column;
 gap: 8px;
}

.crew-card h2,
.crew-card h3,
.crew-column h2 {
 margin: 0;
 font-size: 1rem;
}

.crew-board {
 display: grid;
 grid-template-columns: repeat(
  4,
  minmax(0, 1fr)
 );
 gap: 12px;
}

.crew-column {
 display: flex;
 flex-direction: column;
 gap: 8px;
 min-width: 0;
}

.crew-form,
.crew-field {
 display: flex;
 flex-direction: column;
 gap: 8px;
}

.crew-field textarea,
.crew-card textarea {
 width: 100%;
 min-height: 72px;
}

.crew-error {
 color: #b42318;
 margin: 0;
}

.crew-note {
 margin: 0;
}

.crew-deliverable {
 white-space: pre-wrap;
 margin: 0;
 font: inherit;
}

.crew-member-gallery {
 display: grid;
 grid-template-columns: repeat(
  auto-fill,
  minmax(220px, 1fr)
 );
 gap: 12px;
}

.crew-member-card {
 display: flex;
 flex-direction: column;
 gap: 10px;
 border: 1px solid var(--border);
 border-radius: 12px;
 padding: 14px;
 background: var(--background);
}

.crew-member-open {
 display: flex;
 flex-direction: column;
 align-items: flex-start;
 gap: 4px;
 width: 100%;
 padding: 0;
 border: none;
 background: none;
 color: inherit;
 text-align: left;
 cursor: pointer;
}

.crew-member-card .muted,
.crew-member-open .muted {
 display: block;
}

.crew-transcript {
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.crew-monologue {
 white-space: pre-wrap;
 margin: 0;
}

.crew-agent-grid {
 display: grid;
 grid-template-columns: repeat(
  auto-fill,
  minmax(220px, 1fr)
 );
 gap: 12px;
}

.crew-agent-list {
 display: flex;
 flex-direction: column;
 gap: 8px;
}

.crew-agent-row,
.crew-msg-head {
 display: flex;
 gap: 8px;
 flex-wrap: wrap;
 align-items: center;
}

.crew-transcript-link {
 background: none;
 border: none;
 padding: 0;
 color: inherit;
 font: inherit;
 text-align: left;
 text-decoration: underline;
 cursor: pointer;
}

.crew-chat {
 display: flex;
 flex-direction: column;
 gap: 12px;
 max-height: 360px;
 overflow: auto;
}

.crew-msg {
 display: flex;
 flex-direction: column;
 gap: 2px;
}

.crew-msg p {
 margin: 0;
 white-space: pre-wrap;
}

@media (max-width: 900px) {
 .crew-page {
  flex-direction: column;
 }

 .crew-pane {
  width: 100%;
  flex-basis: auto;
  max-height: 40%;
  border-right: none;
  border-bottom: 1px solid var(--border);
 }

 .crew-board {
  grid-template-columns: 1fr;
 }
}
