/* The member conversation uses Release's editorial type and the room palette. */
.conversation-home {
  --paper: var(--bg);
  --editorial: Georgia, "Times New Roman", serif;
  --notation: Menlo, Consolas, monospace;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
html:not([data-type="house"]) .conversation-home { --editorial: var(--display); }
.conversation-home .top { border: 0; flex: none; }
.conversation-home .top-inner { border-bottom: 2px solid var(--ink); min-height: 60px; }
.conversation-home .chev, .conversation-home .crumb, .conversation-home #breadcrumb { display: none; }
.conversation-home .channel-nav a { color: var(--ink); }
.conversation-home .channel-nav [aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.conversation-home .top .wordmark { color: var(--ink); }
.conversation-home .room-frame { flex: 1; min-height: 0; padding-bottom: 0; }
.conversation-home #app, .thread-layout { height: 100%; }
.thread-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .46fr); gap: clamp(32px, 6vw, 84px); }
.thread { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.thread-head { padding: clamp(16px, 3vh, 36px) 0 18px; border-bottom: 1px solid var(--rule); }
.thread-meta, .thread-event small, .turn small, .draft-review dt { font: 11px/1.5 var(--notation); color: var(--muted); }
.thread-meta { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
#thread-meta { display: inline-flex; align-items: center; gap: 8px; }
#thread-meta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); }
#thread-cancel { text-decoration: underline; text-underline-offset: 3px; padding: 5px 0 5px 10px; }
#thread-heading { font: 400 clamp(34px, 4.8vw, 68px)/1.08 var(--editorial); letter-spacing: -.04em; margin: 4px 0 8px; overflow-wrap: anywhere; }
#thread-brief { font-size: 15px; color: var(--muted); max-width: 68ch; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#conversation-feed { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 18px 4px 12px 0; }
.turn { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; overflow-wrap: anywhere; }
.turn-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--rule); color: var(--accent-text); background: var(--surface-2); font: 13px var(--notation); border-radius: 50%; }
.own-turn .turn-avatar { color: var(--ink); background: var(--surface); }
.turn > div { min-width: 0; }
.turn header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.turn b { color: var(--accent-text); font-size: 14px; }
.turn p, .thread-event p { font-size: 16px; line-height: 1.45; white-space: pre-wrap; }
.thread-event { border-left: 2px solid var(--rule); margin: 0 0 20px 15px; padding-left: 26px; overflow-wrap: anywhere; }
.thread-event p { font-size: 14px; color: var(--muted); }
.draft-review { padding: 15px 18px; margin: 12px 0 1px; border: 1px solid var(--rule); border-left: 3px solid var(--accent-text); overflow-wrap: anywhere; }
.draft-review h2, .thread-side h2 { font: 400 26px/1.2 var(--editorial); letter-spacing: -.03em; }
.draft-review dl { margin: 9px 0; }
.draft-review dl > div { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; border-top: 1px solid var(--rule); padding: 6px 0; }
.draft-review dt { grid-column: 1 / -1; }
.draft-review dd { font-size: 15px; }
.draft-review button { min-height: 40px; min-width: 44px; font: 12px var(--sans); text-decoration: underline; color: var(--accent-text); padding: 5px 2px 5px 12px; }
.draft-review > p { color: var(--muted); font-size: 13px; }
#thread-composer { padding: 8px 0 20px; background: var(--surface); border-top: 1px solid var(--rule); }
#thread-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#thread-actions button { font-size: 13px; padding: 4px 10px; min-height: 36px; border: 1px solid var(--rule); border-radius: 4px; }
#thread-actions:not(:empty) { margin: 0 0 8px; }
.thread-input-row { display: flex; align-items: flex-end; gap: 8px; }
#thread-input { flex: 1; min-width: 0; min-height: 46px; max-height: 112px; max-height: calc(4lh + 22px); field-sizing: content; resize: none; overflow-y: auto; border: 1px solid var(--rule); background: var(--surface); border-radius: 4px; padding: 10px 12px; font: 16px/1.4 var(--sans); }
#thread-submit { background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 4px; min-height: 46px; font-weight: 600; }
#thread-confirm { width: 100%; min-height: 48px; padding: 8px 16px; border-radius: 4px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
#thread-submit:disabled, #thread-confirm:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); }
#thread-mentions:not([hidden]) { list-style: none; padding: 0; margin: 0 0 6px; max-height: 135px; overflow: auto; border: 1px solid var(--rule); }
#thread-mentions button { color: var(--ink); min-height: 40px; padding: 5px 10px; width: 100%; text-align: left; }
#thread-mentions button.current { color: var(--accent-text); background: var(--surface-2); }
#thread-status:not(:empty) { font-size: 13px; padding-top: 5px; }
.thread-side { align-self: start; margin-top: 36px; padding: 14px 0; border-top: 2px solid var(--ink); }
.thread-side img { width: 100%; aspect-ratio: 1.85; object-fit: cover; margin-top: 12px; }
.thread-side p { margin: 12px 0; overflow-wrap: anywhere; }
.thread-side a { display: block; margin: 10px 0; }
@media (max-width: 720px) {
  .conversation-home .top-inner { min-height: 50px; }
  .conversation-home .top-right { margin-left: auto; }
  .conversation-home .room-frame { padding-bottom: calc(57px + env(safe-area-inset-bottom)); }
  .thread-layout { display: block; }
  .thread { height: 100%; }
  .thread-head { padding: 11px 0 12px; }
  #thread-heading { margin: 2px 0 4px; }
  .thread-side { display: none; }
  #thread-composer { padding: 8px 0; }
  #thread-actions button { min-height: 40px; }
  .conversation-home .mobile-bar { background: var(--surface); }
}
@media (max-height: 540px) {
  .thread-head { padding-block: 3px; }
  #thread-heading { font-size: 25px; }
  #thread-brief { display: none; }
  #conversation-feed { padding-top: 8px; }
}
.conversation-home .top-inner:has(.design-switch[hidden]) #breadcrumb { display: none; }
.thread-build { margin: 0 0 22px; }
.thread-build a { display: flex; gap: 14px; align-items: center; border-block: 1px solid var(--rule); text-decoration: none; color: var(--ink); padding: 8px 0; }
.thread-build img { width: 96px; height: 57px; object-fit: cover; }
.thread-build small, .thread-side li small { display: block; font: 11px/1.5 var(--notation); color: var(--muted); }
.thread-build strong { display: block; font: 22px/1.2 var(--editorial); }
.thread-build a > span:last-child { margin-left: auto; padding: 8px; }
.thread-side li { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.thread-side li a { margin: 0 0 3px; color: var(--ink); }
.turn details { font: 12px/1.5 var(--notation); color: var(--muted); margin-top: 5px; }
.turn details summary { cursor: pointer; }
.market-choice { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 6px 0; min-height: 36px; }
.thread-order { border-left: 2px solid var(--accent-text); margin: 0 0 20px 15px; padding-left: 26px; overflow-wrap: anywhere; }
.thread-order small { font: 11px/1.5 var(--notation); color: var(--muted); }
.thread-order a { display: block; font: 22px/1.25 var(--editorial); margin: 4px 0; color: var(--ink); }
.thread-order p { font-size: 13px; color: var(--muted); }
.drafting-room-action .studio-btn { display: none; }

#draft-progress { margin-bottom: 6px; }
#draft-progress summary { width: fit-content; cursor: pointer; padding: 8px 0; font: 12px/1.4 var(--notation); color: var(--accent-text); }
#draft-progress dl { max-height: min(18dvh, 9rem); overflow-y: auto; padding: 0 12px; border-left: 2px solid var(--accent); }
#draft-progress dl > div { display: grid; grid-template-columns: minmax(70px, .35fr) 1fr; gap: 10px; padding-block: 4px; }
#draft-progress dt { font: 11px/1.5 var(--notation); color: var(--muted); }
#draft-progress dd { font-size: 14px; overflow-wrap: anywhere; }

.drafting-room-action .thread-layout { grid-template-columns: minmax(0, 780px); justify-content: center; }
.drafting-room-action .thread-side { display: none; }
#thread-submit .send-label { margin-right: .25em; }
.thread-day { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 20px; font: 600 12px/1.4 var(--sans); color: var(--muted); }
.thread-day::before, .thread-day::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* Space chat lives between the shared player and navigation. */
.space-home.conversation-home .thread-layout { display: grid; grid-template-columns: minmax(0, 800px); justify-content: center; gap: 0; }
.space-home .thread-side { display: none; }
.space-home .thread-head { padding: 10px 0 8px; }
.space-home:not(.drafting-room-action) #thread-heading, .space-home:not(.drafting-room-action) #thread-brief { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.space-home .thread-head, .space-home #thread-composer { border: 0; }
.space-home #conversation-feed { padding: 2px 0 6px; scrollbar-gutter: stable; }
.space-home .turn { align-items: end; gap: 8px; margin: 0 0 14px; }
.space-home .turn-avatar { width: 31px; height: 31px; font: 650 12px/1 var(--sans); }
.space-home .turn > div { width: fit-content; max-width: min(80%, 40rem); border: 1px solid var(--rule); background: var(--surface-2); padding: 9px 13px 10px; border-radius: 18px 18px 18px 5px; }
.space-home .turn header { gap: 5px 10px; margin: 0 0 3px; }
.space-home .turn header b { font: 650 12px/1.35 var(--sans); }
.space-home .turn header small { font: 11px/1.4 var(--sans); color: var(--muted); }
.space-home .turn p { font: 400 15px/1.43 var(--sans); }
.space-home .turn.own-turn { flex-direction: row-reverse; }
.space-home .own-turn > div { border-radius: 18px 18px 5px 18px; }
.space-home .thread-event { padding-left: 12px; margin: 3px 0 16px 40px; }
.space-home .thread-event small, .space-home .thread-order small { font: 500 11px/1.4 var(--sans); }
.space-home .thread-event p { margin: 2px 0; font: 400 13px/1.45 var(--sans); }
.space-home .thread-order { margin: 4px 0 18px 39px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 14px; }
.space-home .thread-order a { font: 600 16px/1.35 var(--sans); }
.space-home #thread-composer { padding: 5px 0 12px; background: transparent; }
.space-home #thread-actions { gap: 6px; }
.space-home #thread-actions button { padding: 4px 10px; min-height: 36px; border-radius: 99px; }
.space-home .thread-input-row { align-items: flex-end; gap: 5px; border: 1px solid var(--rule); background: var(--surface-2); border-radius: 24px; padding: 3px; }
.space-home .thread-input-row:focus-within { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.space-home #thread-input { border: 0; background: transparent; box-shadow: none; outline: none; padding-inline: 11px 3px; color: var(--ink); }
.space-home #thread-submit { width: 44px; min-height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: 23px; }
.space-home #thread-submit .send-label { display: none; }
.space-home #thread-submit[hidden], .space-home .reviewing .thread-input-row { display: none; }
.space-home #thread-confirm { border-radius: 16px; }
.space-home .draft-review { border-radius: 16px; padding: 13px 16px; background: var(--surface-2); border: 1px solid var(--rule); }
.space-home .draft-review h2 { font: 600 23px/1.2 var(--sans); letter-spacing: -.035em; }
.space-home.drafting-room-action #thread-heading { font: 600 clamp(24px,4vw,32px)/1.1 var(--sans); }
:root[data-palette="house"] .space-home.conversation-home .thread-layout {
  --ink: #f6f4f0; --bg: #141516; --surface: #18191b; --surface-2: #262729; --rule: #414244; --muted: #b2b2b5; --accent-text: var(--brand-blue-light);
  color: var(--ink);
}
:root[data-palette="house"] .space-home .turn > div { background: linear-gradient(135deg,#303133,#252628 84%); border-color: #3c3d3e; }
:root[data-palette="house"] .space-home .turn.own-turn > div { background: #202f43; border-color: #344963; }
:root[data-palette="house"] .space-home .turn-avatar { color: #fff2db; background: #5e4536; border-color: #78614f; }
:root[data-palette="house"] .space-home .turn-tone-1 { color: #ffe1d3; background: #63433e; }
:root[data-palette="house"] .space-home .turn-tone-2 { color: #dfe8fc; background: #40495a; }
:root[data-palette="house"] .space-home .turn-tone-3 { color: #e1e8db; background: #495346; }
:root[data-palette="house"] .space-home .turn-tone-4 { color: #ede1f5; background: #584a5c; }
:root[data-palette="house"] .space-home #thread-actions button { color: var(--ink); background: #272829; }
:root[data-palette="house"] .space-home #thread-submit:disabled { background: #414245; color: #c3c3c5; }
@media (max-height: 650px) {
  .space-home .thread-head { padding-block: 3px; }
  .space-home #thread-actions:not(:empty) { margin-bottom: 4px; }
  .space-home.drafting-room-action #thread-brief { display: none; }
}
.space-home .thread-meta { gap: 8px; justify-content: flex-start; }
.space-home .thread-attachment { margin: 10px 0 16px 39px; width: min(calc(100% - 39px),340px); }
.thread-attachment > small { display: block; margin-bottom: 5px; color: var(--muted); font: 600 11px/1.4 var(--sans); }
.thread-attachment > button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface-2); color: var(--ink); text-align: left; }
.thread-attachment > button img { width: 70px; height: 46px; border-radius: 7px; object-fit: cover; }
.thread-attachment span { min-width: 0; }
.thread-attachment strong, .thread-attachment span small { display: block; font: 650 14px/1.4 var(--sans); overflow-wrap: anywhere; }
.thread-attachment span small { color: var(--muted); font-size: 11px; font-weight: 500; }
.thread-attachment i { display: grid; flex-shrink: 0; place-items: center; width: 32px; height: 32px; margin-left: auto; border-radius: 50%; background: var(--ink); color: var(--surface); font: 11px/1 var(--sans); }
.shared-work-link { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
.space-home #thread-actions #thread-quick-create {
  display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 12px; width: 100%; min-height: 48px; padding: 8px 14px;
  text-align: left; border-radius: 14px; border-color: var(--rule); background: var(--surface-2);
}
#thread-quick-create span { font-size: 11px; line-height: 1.4; color: var(--accent-text); }
#thread-quick-create strong { grid-column: 1; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
#thread-quick-create i { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent-text); font: 19px/1 var(--sans); }
.space-home #thread-actions #thread-quick-create[hidden] { display: none; }

.space-home:not(.drafting-room-action) .thread-head { min-height: 0; height: 0; padding: 0; overflow: hidden; }
.space-home:not(.drafting-room-action) .thread-meta { display: none; }
#composer-tools { position: relative; flex: none; }
#composer-tools[hidden] { display: none; }
#composer-tools summary { display: grid; width: 44px; height: 44px; place-items: center; list-style: none; border-radius: 50%; cursor: pointer; color: var(--muted); font: 400 25px/1 var(--sans); }
#composer-tools summary::-webkit-details-marker { display: none; }
#composer-tools[open] summary, #composer-tools summary:hover { background: var(--rule); color: var(--ink); }
#composer-tools summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.composer-menu { position: absolute; z-index: 5; left: 0; bottom: calc(100% + 10px); min-width: 170px; padding: 5px; border: 1px solid var(--rule); border-radius: 15px; background: var(--surface); box-shadow: 0 8px 30px #0004; }
.composer-menu button, .composer-menu a:not([hidden]) { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; text-align: left; font: 600 14px/1.25 var(--sans); color: var(--ink); }
.composer-menu button:hover, .composer-menu a:hover, .composer-menu :focus-visible { background: var(--surface-2); color: var(--accent-text); }
.space-home:not(.drafting-room-action) #thread-input { padding-left: 0; }

.space-home #conversation-feed:has(.thread-welcome) { display:flex; flex-direction:column; }
.thread-welcome { margin:auto 0 clamp(12px,6vh,64px); padding:16px 4px; max-width:min(100%,56ch); list-style:none; }
.welcome-mark { display:grid; place-items:center; width:52px; height:52px; border-radius:50%; background:#192d43; color:#95bded; }
.welcome-mark.mark-1 { background:#28253a; color:#c2b5df; }
.welcome-mark.mark-2 { background:#202f32; color:#99c8c5; }
.welcome-mark.mark-3 { background:#343026; color:#dac6a1; }
.welcome-mark svg { width:31px; height:31px; }
.thread-welcome h1 { margin:16px 0 6px; color:var(--ink); font:650 clamp(24px,3vw,38px)/1.1 var(--sans); letter-spacing:-.04em; overflow-wrap:anywhere; }
.thread-welcome p { margin:0; color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
.thread-welcome > div { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.thread-welcome button { min-height:44px; padding:0 14px; border:1px solid var(--rule); border-radius:99px; color:var(--ink); background:var(--surface-2); font-weight:600; }
.thread-welcome button:first-child { background:var(--accent); color:var(--accent-ink); border-color:transparent; }
.draft-privacy { width:100%; display:flex; align-items:center; gap:10px; min-height:44px; font:600 14px/1.35 var(--sans); cursor:pointer; }
.draft-privacy input { width:18px; height:18px; flex:none; accent-color:var(--accent); }
.draft-privacy small { display:block; color:var(--muted); font:400 12px/1.4 var(--sans); }
