/* All layout rules stay in this external sheet for style-src 'self'. */
body.fb-project:has(#conversations.chat-open:not([hidden])) { padding-top: 0; min-height: 0; }
body.fb-project:has(#conversations.chat-open:not([hidden])) .app-topbar { display: none !important; }
body.fb-project:has(#conversations.chat-open:not([hidden])) .shell {
  height: var(--app-height, 100dvh); min-height: 0; max-height: var(--app-height, 100dvh);
  padding-top: env(safe-area-inset-top);
}
body.fb-project:has(#conversations.chat-open:not([hidden])) .connection-banner { top: env(safe-area-inset-top); }
#chat-active.fb-active { display: grid; grid-template-rows: minmax(0, 1fr) 12px minmax(0, 1fr); overflow: hidden; }
#chat-active.fb-active[hidden] { display: none; }
#chat-active.fb-active > .chat-header { display: none; }
#chat-active.fb-active[data-fb-ratio="30"] { grid-template-rows: minmax(0, 3fr) 12px minmax(0, 7fr); }
#chat-active.fb-active[data-fb-ratio="35"] { grid-template-rows: minmax(0, 35fr) 12px minmax(0, 65fr); }
#chat-active.fb-active[data-fb-ratio="40"] { grid-template-rows: minmax(0, 4fr) 12px minmax(0, 6fr); }
#chat-active.fb-active[data-fb-ratio="45"] { grid-template-rows: minmax(0, 45fr) 12px minmax(0, 55fr); }
#chat-active.fb-active[data-fb-ratio="55"] { grid-template-rows: minmax(0, 55fr) 12px minmax(0, 45fr); }
#chat-active.fb-active[data-fb-ratio="60"] { grid-template-rows: minmax(0, 6fr) 12px minmax(0, 4fr); }
#chat-active.fb-active[data-fb-ratio="65"] { grid-template-rows: minmax(0, 65fr) 12px minmax(0, 35fr); }
#chat-active.fb-active[data-fb-ratio="70"] { grid-template-rows: minmax(0, 7fr) 12px minmax(0, 3fr); }
.fb-upper { display: flex; min-height: 0; min-width: 0; background: var(--paper); }
.fb-task { display: flex; flex-direction: column; flex: 1; min-width: 0; position: relative; }
.fb-board-host { flex: 1; min-height: 0; }
.fb-avatar { flex: none; width: auto; min-width: 46px; height: 46px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--base); font-size: 27px; cursor: pointer; }
.fb-avatar-emoji { font-size: 27px; }
.fb-avatar-name { font-size: 13px; font-weight: 650; white-space: nowrap; }
.fb-splitter { background: var(--base); border-block: 1px solid var(--line); cursor: row-resize; touch-action: none; position: relative; }
.fb-splitter::after { content: ''; position: absolute; top: 4px; left: calc(50% - 25px); width: 50px; height: 2px; background: var(--muted); border-radius: 2px; }
.fb-splitter:focus-visible { outline: 2px solid #5f71d9; outline-offset: -2px; }
.fb-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; overflow: auto; }
.fb-chat .message-list { flex: 1; min-height: 30px; }
.fb-chat .composer { flex-shrink: 0; margin-bottom: max(8px, env(safe-area-inset-bottom)); }
.fb-drawer { position: fixed; inset: auto; top: 0; right: 0; margin: 0; width: min(430px, calc(100vw - 20px)); height: 100vh; height: 100dvh; max-height: 100dvh; max-width: 100%; border: 1px solid var(--line); border-right: none; border-radius: 16px 0 0 16px; box-shadow: -18px 0 50px rgba(20, 24, 43, .22), -4px 0 14px rgba(20, 24, 43, .10); padding: 18px 20px 20px; color: var(--ink); background: var(--paper); overflow-y: auto; }
.fb-drawer[open] { display: block; animation: fb-drawer-in .3s cubic-bezier(0.32, 0.72, 0, 1); }
.fb-drawer::backdrop { background: transparent; }
.fb-drawer > header { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 22px; }
.fb-drawer h2 { font-size: 17px; margin: 0; }
.fb-drawer h3 { font-size: 15px; margin: 0 0 12px; }
.fb-panel-action { width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--base); color: var(--ink); font-size: 14px; cursor: pointer; }
.fb-panel-action:hover { background: #e9ede4; }
.fb-rule-rows { display: grid; gap: 8px; margin-top: 10px; }
.fb-readonly { font-size: 12px; color: var(--muted); }
.fb-rules details { border-bottom: 1px solid var(--line); padding: 13px 0; }
.fb-rules summary { cursor: pointer; font-size: 13px; }
.fb-rules summary small { display: block; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.fb-rules pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 12px; line-height: 1.8; margin: 14px 0 0; }
.fb-members { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.member-row .fb-crew-rank { color: var(--ink); font-weight: 650; }
.thread-item.fb-project-row .thread-copy { padding-right: 70px; }
.thread-item.fb-project-row .thread-copy strong { margin-right: 0; }
.fb-followers { position: absolute; right: 12px; top: 36px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
@keyframes fb-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .fb-drawer[open] { animation: none; } }
@media (max-width: 800px) {
  .fb-avatar { height: 42px; padding: 0 10px; }
  .fb-avatar-name { font-size: 12px; }
  .fb-chat .composer { margin-inline: 8px; }
  .fb-drawer { padding-inline: 16px; }
}
