.shell[data-product-mode="chat"] {
  --chat-accent: #72dedb;
  --chat-blue: #7cbdf3;
  --chat-green: #75cf91;
  --chat-amber: #ddb66f;
  --chat-red: #da9292;
  --chat-rail-action-size: 32px;
}

.chat-rail-toggle {
  display: grid;
  width: var(--chat-rail-action-size);
  height: var(--chat-rail-action-size);
  flex: 0 0 var(--chat-rail-action-size);
  place-items: center;
  border: 1px solid #34474a;
  border-radius: 8px;
  background: #131a1c;
  color: #b8cacc;
  padding: 0;
}

.chat-rail-toggle svg,
.chat-command-room-create-toggle svg,
.product-mode-glyph svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-rail-toggle svg {
  transition: transform 140ms ease;
}

.chat-rail-toggle[data-direction="expand"] svg {
  transform: rotate(180deg);
}

.chat-rail-toggle:hover,
.chat-rail-toggle:focus-visible {
  border-color: #4d797c;
  color: #e5ffff;
  outline: none;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] {
  grid-template-columns: 76px minmax(0, 1fr) 340px;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .rooms-panel {
  width: 76px;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .brand-lockup > div,
.shell[data-product-mode="chat"][data-chat-rail="compact"] .brand-controls > :not(.chat-rail-toggle),
.shell[data-product-mode="chat"][data-chat-rail="compact"] .domain-context-rail .domain-rail-head,
.shell[data-product-mode="chat"][data-chat-rail="compact"] .domain-context-rail .domain-rail-meta,
.shell[data-product-mode="chat"][data-chat-rail="compact"] .domain-context-rail button > span:not(:first-child),
.shell[data-product-mode="chat"][data-chat-rail="compact"] .rooms-footer {
  display: none !important;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .brand {
  justify-content: center;
  padding-inline: 8px;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .brand-lockup {
  display: none;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .brand-controls {
  display: grid;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .domain-context-rail {
  padding-inline: 7px;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .domain-context-rail button {
  min-width: 48px;
  justify-content: center;
  padding-inline: 7px;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-toolbar__heading,
.shell[data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-search,
.shell[data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-create {
  display: none !important;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-toolbar__controls {
  justify-content: center;
}

.shell[data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-create-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
}

.chat-room-truth {
  display: grid;
  gap: 8px;
  border-top: 1px solid #283639;
  padding: 10px 12px;
}

.chat-room-truth[hidden] {
  display: none;
}

.chat-room-truth > details {
  border: 1px solid #314246;
  border-radius: 8px;
  background: #111719;
}

.chat-room-truth summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  color: #bfd0d2;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-room-truth__body {
  display: grid;
  gap: 7px;
  border-top: 1px solid #2b3a3d;
  padding: 8px;
}

.chat-room-truth__empty {
  margin: 0;
  color: #819598;
  font-size: 0.68rem;
  line-height: 1.4;
}

.aaa-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid #2f4144;
  padding: 8px 12px 11px;
  background: linear-gradient(180deg, #101617 0%, #0c1213 100%);
}

.aaa-composer .composer-context {
  display: flex;
  grid-column: 1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #8da2a5;
  font-size: 0.67rem;
}

.aaa-composer .composer-context strong {
  color: #d9e8e9;
}

.composer-context__mode {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.composer-context__cancel {
  min-height: 28px !important;
  border: 1px solid #546b6f;
  border-radius: 8px;
  padding: 3px 9px;
  color: #d9e8e9;
  background: #182325;
  font: inherit;
}

.aaa-composer[data-editing="true"] {
  border-top-color: #60d5d5;
  box-shadow: 0 -1px 0 rgb(96 213 213 / 16%);
}

.aaa-composer[data-editing="true"] .aaa-composer__submit {
  background: #296b69;
}

.aaa-composer__surface {
  display: grid;
  grid-column: 1;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.aaa-composer__editor-shell {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 6px;
  border: 1px solid #3c5357;
  border-radius: 12px;
  padding: 7px 10px;
  background: #111819;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 2%);
}

.aaa-composer__editor-shell:focus-within {
  border-color: #5b999b;
  box-shadow: 0 0 0 2px rgb(114 222 219 / 12%);
}

.aaa-composer__editor {
  min-height: 52px;
  max-height: 190px;
  overflow: auto;
  color: #e7f0f1;
  font-size: 0.86rem;
  line-height: 1.48;
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.aaa-composer__editor:empty::before {
  color: #718487;
  content: attr(data-placeholder);
  pointer-events: none;
}

.aaa-composer__hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #708386;
  font-size: 0.62rem;
}

.aaa-composer__hint-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.aaa-composer__hint-actions button {
  border: 0;
  border-radius: 6px;
  padding: 3px 6px;
  background: transparent;
  color: #8ecdd0;
  font: inherit;
  font-weight: 800;
}

.aaa-composer__hint-actions button:hover,
.aaa-composer__hint-actions button:focus-visible,
.aaa-composer__hint-actions button[aria-expanded="true"] {
  background: #1b3033;
  color: #d8fbfc;
  outline: none;
}

.aaa-composer__hint [data-draft-kind="semantic"] {
  color: #a8d7d8;
}

.aaa-composer__preview,
.aaa-composer__submit {
  min-height: 46px;
  border-radius: 10px;
  padding: 8px 13px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
}

.aaa-composer__preview {
  border: 1px solid #466d80;
  background: #152932;
  color: #d6efff;
}

.aaa-composer__preview[aria-pressed="true"] {
  border-color: #72b6da;
  background: #1a3b4b;
}

.aaa-composer__submit {
  border: 1px solid #4d7b5a;
  background: #1d4a2b;
  color: #ecfff0;
}

.aaa-composer__submit:disabled,
.aaa-composer__preview:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.semantic-selection-toolbar {
  position: absolute;
  z-index: 30;
  display: none;
  max-width: min(520px, calc(100vw - 28px));
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  border: 1px solid #507a7e;
  border-radius: 10px;
  padding: 5px;
  background: #182325;
  box-shadow: 0 18px 44px rgb(0 0 0 / 42%);
}

.semantic-selection-toolbar[data-open="true"] {
  display: flex;
}

.semantic-selection-toolbar[data-guide="true"] {
  right: 12px;
  bottom: calc(100% + 8px);
}

.semantic-selection-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.semantic-selection-toolbar > span {
  padding: 0 5px;
  color: #8ca1a4;
  font-size: 0.65rem;
}

.semantic-selection-toolbar button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  background: transparent;
  color: #d6e3e5;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 780;
}

.semantic-selection-toolbar button:hover,
.semantic-selection-toolbar button:focus-visible {
  border-color: #4d7478;
  background: #223236;
  outline: none;
}

.semantic-selection-toolbar button[data-semantic-type="IDEA"] {
  color: #c4e1ff;
}

.semantic-selection-toolbar button[data-semantic-type="DECISION"] {
  color: #c8f4d5;
}

.semantic-selection-toolbar button[data-semantic-type="QUESTION"] {
  color: #ffe7b8;
}

.semantic-selection-toolbar button[data-semantic-type="TASK"] {
  color: #ffd1d1;
}

.semantic-draft-block,
.semantic-block {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  gap: 5px;
  margin: 1px 2px;
  border: 1px solid var(--semantic-accent, #6caee5);
  border-radius: 7px;
  padding: 2px 5px 3px;
  background: var(--semantic-bg, #19324a);
  color: var(--semantic-text, #e4f2ff);
  box-decoration-break: clone;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%);
  cursor: pointer;
  font: inherit;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.semantic-message-block-shell {
  display: inline;
  min-width: 0;
  margin: 0;
}

.semantic-block {
  display: inline-flex;
  width: auto;
  max-width: min(100%, 680px);
  align-items: baseline;
  gap: 6px;
  margin: 1px 3px;
  border-radius: 8px;
  padding: 3px 7px;
  text-align: left;
  vertical-align: baseline;
}

.semantic-block__head {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.semantic-block__title {
  display: none;
}

.semantic-block__state {
  display: none;
}

.semantic-block__configuration {
  display: none;
}

.semantic-block--decision > .semantic-block__decision-contract {
  display: inline-flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 2px 6px;
  color: color-mix(in srgb, var(--semantic-text) 78%, transparent);
  font-size: 0.6rem;
}

/* Human-first Decision mobile card */
@media (max-width: 620px) {
  .semantic-message-block-shell[data-semantic-block-type="DECISION"] {
    display: block;
    width: 100%;
    margin-block: 7px;
  }

  .semantic-message-block-shell > .semantic-block--decision {
    display: grid;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin-inline: 0;
    padding: 10px;
    white-space: normal;
  }

  .semantic-block--decision > .semantic-block__head {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
  }

  .semantic-block--decision > .semantic-block__text {
    display: block;
    width: 100%;
    min-width: 0;
    font-weight: 650;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .semantic-block--decision > .semantic-block__decision-contract {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    border-top: 1px solid color-mix(in srgb, var(--semantic-accent) 34%, transparent);
    padding-top: 8px;
  }

  .semantic-block--decision .semantic-block__contract-fact {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .semantic-block--decision .semantic-block__contract-fact > strong,
  .semantic-block--decision .semantic-block__contract-fact > span {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .semantic-block--decision > .semantic-block__interaction-summary {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin-top: 0;
  }

  .semantic-block--decision .semantic-block__metric,
  .semantic-block--decision .semantic-block__open-label {
    max-width: 100%;
  }
}
/* End Human-first Decision mobile card */

/* Human-first Task card */
.semantic-message-block-shell:has(> .semantic-block--task) {
  display: block;
  width: 100%;
  margin-block: 7px;
}

.semantic-message-block-shell > .semantic-block--task {
  --semantic-accent: #8fa9ac;
  --semantic-bg: #142022;
  --semantic-text: #e2edef;
  display: grid;
  width: min(100%, 860px);
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-inline: 0;
  padding: 12px;
}

.semantic-block--task > .semantic-block__head {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
}

.semantic-block--task .semantic-block__title {
  display: block;
  min-width: 0;
  color: var(--semantic-text);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.semantic-block--task .semantic-block__state {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--semantic-accent) 55%, transparent);
  border-radius: 999px;
  padding: 3px 7px;
  color: #cbdadc;
  font-size: 0.62rem;
  font-weight: 850;
  white-space: nowrap;
}

.semantic-block--task > .semantic-block__execution-contract,
.semantic-block--task > .semantic-task-lifecycle,
.semantic-block--task > .semantic-block__interaction-summary {
  grid-column: 1 / -1;
}

.semantic-block--task > .semantic-block__execution-contract {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--semantic-accent) 34%, transparent);
  color: #afc2c5;
  font-size: 0.7rem;
}

.semantic-block--task .semantic-block__contract-fact {
  display: grid;
  grid-template-columns: minmax(126px, auto) minmax(0, 1fr);
  gap: 8px;
}

.semantic-block--task .semantic-block__contract-fact > span,
.semantic-block--task .semantic-block__contract-fact > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

[data-block-type="TASK"] .semantic-interaction-tabs,
[data-block-type="TASK"] button,
[data-block-type="TASK"] select,
[data-block-type="TASK"] > footer {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
}

[data-block-type="TASK"] .semantic-interaction-tabs,
[data-block-type="TASK"] > footer {
  flex-wrap: wrap;
}

@media (max-width: 620px) {
  .semantic-block--task > .semantic-block__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .semantic-block--task .semantic-block__label,
  .semantic-block--task .semantic-block__title {
    grid-column: 1 / -1;
  }

  .semantic-block--task .semantic-block__state {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .semantic-block--task > .semantic-block__execution-contract {
    grid-template-columns: minmax(0, 1fr);
  }

  .semantic-block--task .semantic-block__contract-fact {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}
/* End Human-first Task card */

.semantic-block__contract-fact {
  display: inline-flex;
  min-width: 0;
  gap: 3px;
}

.semantic-block__contract-fact strong {
  color: var(--semantic-text);
}

.semantic-draft-block--idea,
.semantic-block--idea {
  --semantic-accent: #6caee5;
  --semantic-bg: #19324a;
  --semantic-text: #e4f2ff;
}

.semantic-draft-block--decision,
.semantic-block--decision {
  --semantic-accent: #69bb82;
  --semantic-bg: #173824;
  --semantic-text: #e2ffeb;
}

.semantic-draft-block--question,
.semantic-block--question {
  --semantic-accent: #d3ad69;
  --semantic-bg: #3c3019;
  --semantic-text: #fff1cf;
}

.semantic-draft-block--task,
.semantic-block--task {
  --semantic-accent: #d08d8d;
  --semantic-bg: #3d2224;
  --semantic-text: #ffe7e7;
}

.semantic-draft-block:focus-visible,
.semantic-block:focus-visible {
  outline: 2px solid var(--semantic-accent);
  outline-offset: 2px;
}

.semantic-draft-block__badge,
.semantic-block__badge {
  flex: 0 0 auto;
  border-radius: 4px;
  padding: 1px 4px;
  background: rgb(0 0 0 / 18%);
  font-size: 0.62rem;
  font-weight: 900;
}

.semantic-draft-block__text,
.semantic-block__text {
  min-width: 0;
}

.semantic-block > .semantic-block__text {
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
}

.semantic-block__head > .semantic-block__interaction-summary {
  display: inline-flex;
  gap: 4px;
  border: 0;
  padding: 0;
}

.semantic-block__head > .semantic-block__interaction-summary .semantic-block__metric {
  display: none;
}

.semantic-block__head > .semantic-block__interaction-summary .semantic-block__metric[data-metric="primary"],
.semantic-block__head > .semantic-block__interaction-summary .semantic-block__metric[data-metric="rating"],
.semantic-block__head > .semantic-block__interaction-summary .semantic-block__metric[data-metric="own-rating"],
.semantic-block__head > .semantic-block__interaction-summary .semantic-block__metric[data-metric="reactions"] {
  display: inline;
  border: 1px solid color-mix(in srgb, var(--semantic-accent) 28%, transparent);
  padding: 2px 6px;
  background: color-mix(in srgb, var(--semantic-accent) 8%, transparent);
  color: color-mix(in srgb, var(--semantic-text) 86%, transparent);
  font-size: 0.66rem;
  line-height: 1.2;
}

.semantic-block__head > .semantic-block__interaction-summary .semantic-block__open-label {
  display: none;
}

.semantic-thread-panel {
  display: block;
  width: 100%;
  margin-top: 9px;
}

.semantic-draft-block__configured {
  flex: 0 0 auto;
  color: #8ee6a6;
  font-size: 0.72rem;
  font-weight: 900;
}

.semantic-draft-block[data-configured="true"] {
  box-shadow:
    inset 0 0 0 1px rgb(142 230 166 / 24%),
    0 0 0 1px rgb(142 230 166 / 10%);
}

.semantic-draft-block--preview {
  display: inline-grid;
  min-width: min(420px, 100%);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 8px;
  margin-block: 5px;
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.semantic-draft-block__preview-details {
  display: grid;
  grid-column: 1 / -1;
  gap: 3px;
  border-top: 1px solid color-mix(in srgb, var(--semantic-accent) 40%, transparent);
  padding-top: 6px;
}

.semantic-draft-block__preview-details:empty {
  display: none;
}

.semantic-draft-block__preview-row {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
  gap: 8px;
  color: color-mix(in srgb, var(--semantic-text) 82%, transparent);
  font-size: 0.7rem;
  line-height: 1.35;
}

.semantic-draft-block__preview-row strong {
  color: var(--semantic-text);
}

.semantic-block__interaction-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-top: 1px solid color-mix(in srgb, var(--semantic-accent) 38%, transparent);
  padding-top: 9px;
  color: color-mix(in srgb, var(--semantic-text) 70%, transparent);
  font-size: 0.64rem;
}

.semantic-block__metric {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgb(0 0 0 / 17%);
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.semantic-block__open-label {
  flex: 0 0 auto;
  margin-left: 0;
  color: var(--semantic-text);
  font-weight: 900;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* Telegram-like Idea message card */
.semantic-message-block-shell:has(> .semantic-block--idea) {
  display: block;
  width: 100%;
  max-width: 100%;
  container: semantic-idea / inline-size;
}

.chat-attachment-drafts {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-attachment-drafts[hidden] {
  display: none;
}

.chat-attachment-draft {
  display: inline-flex;
  max-width: min(100%, 360px);
  align-items: center;
  gap: 6px;
  border: 1px solid #38595d;
  border-radius: 999px;
  padding: 4px 5px 4px 9px;
  background: #152224;
  color: #cfe0e1;
  font-size: 0.68rem;
}

.chat-attachment-draft__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-draft button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #25383b;
  color: #dbe9ea;
  font-size: 1rem;
}

.chat-attachments {
  display: grid;
  width: min(100%, 760px);
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 8px;
  margin-block: 10px 4px;
}

.chat-attachment {
  display: grid;
  min-width: 0;
  overflow: hidden;
  gap: 6px;
  border: 1px solid #36565a;
  border-radius: 12px;
  padding: 7px;
  background: #10191a;
}

.chat-attachment img,
.chat-attachment video {
  display: block;
  width: 100%;
  max-height: min(56vh, 520px);
  border-radius: 8px;
  object-fit: contain;
  background: #090e0f;
}

.chat-attachment audio {
  width: 100%;
}

.chat-attachment__download {
  min-width: 0;
  overflow: hidden;
  color: #8fe3e5;
  font-size: 0.68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-agent-mention-suggestions {
  position: absolute;
  z-index: 24;
  right: 8px;
  bottom: calc(100% - 2px);
  left: 8px;
  max-height: min(320px, 45vh);
  overflow: auto;
  border: 1px solid #3f777a;
  border-radius: 10px;
  padding: 5px;
  background: #0c1314;
  box-shadow: 0 18px 50px rgb(0 0 0 / 46%);
}

.native-agent-mention-suggestions[hidden] {
  display: none;
}

.native-agent-mention-suggestions button {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: transparent;
  color: #e7f0f1;
  text-align: left;
}

.native-agent-mention-suggestions button[aria-selected="true"],
.native-agent-mention-suggestions button:hover,
.native-agent-mention-suggestions button:focus-visible {
  background: #173235;
  outline: none;
}

.native-agent-mention-suggestions strong {
  overflow-wrap: anywhere;
  color: #72dedb;
}

.native-agent-mention-suggestions span {
  color: #8da1a4;
  font-size: 10px;
}

.chat-attachment__preview-trigger,
.chat-attachment-preview__close {
  min-height: 34px;
  border: 1px solid #3a686e;
  border-radius: 9px;
  padding: 6px 10px;
  background: #13272a;
  color: #91edf0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.chat-attachment__preview-trigger:hover,
.chat-attachment__preview-trigger:focus-visible,
.chat-attachment-preview__close:hover,
.chat-attachment-preview__close:focus-visible {
  border-color: #6be2e6;
  outline: 2px solid color-mix(in srgb, #58dce2 34%, transparent);
  outline-offset: 2px;
}

.chat-attachment-preview {
  display: grid;
  min-width: 0;
  gap: 8px;
  border-top: 1px solid #29484c;
  padding-top: 8px;
}

.chat-attachment-preview > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-attachment-preview > header strong {
  min-width: 0;
  overflow: hidden;
  color: #d9edee;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-preview > p {
  margin: 0;
  color: #8ba5a8;
  font-size: 0.66rem;
  line-height: 1.45;
}

.chat-attachment-preview iframe {
  display: block;
  width: 100%;
  height: clamp(420px, 68vh, 760px);
  border: 1px solid #31575c;
  border-radius: 10px;
  background: #050808;
}

@media (max-width: 720px) {
  .chat-attachment-preview iframe {
    height: min(70vh, 620px);
    min-height: 360px;
  }
}

.chat-attachment-telemetry {
  border-top: 1px solid var(--black-lab-line);
  padding-top: 7px;
}

.chat-attachment-telemetry > summary {
  color: var(--black-lab-teal);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.chat-attachment-telemetry__body {
  display: grid;
  gap: 4px;
  padding-top: 7px;
  color: var(--black-lab-muted);
  font-size: 11px;
}

.chat-attachment-telemetry__body p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.chat-attachment-telemetry__body p[data-state="COMPLETED"] {
  color: #7bd8ad;
}

.semantic-block--idea {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
  margin-inline: 0;
  padding: 8px 10px;
  cursor: default;
}

.semantic-block--idea > .semantic-block__head {
  display: grid;
  grid-template-columns: auto minmax(88px, 112px);
  min-width: 0;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}

.semantic-block__rating-disclosure {
  position: relative;
  display: block;
  min-width: 0;
}

.semantic-block__rating-summary {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--semantic-accent) 46%, transparent);
  border-radius: 8px;
  padding: 5px 7px;
  background: rgb(0 0 0 / 17%);
  color: color-mix(in srgb, var(--semantic-text) 88%, transparent);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  cursor: pointer;
}

.semantic-block__rating-summary:hover,
.semantic-block__rating-summary:focus-visible,
.semantic-block__rating-summary[aria-expanded="true"] {
  border-color: var(--semantic-accent);
  background: color-mix(in srgb, var(--semantic-accent) 17%, #0c1719);
  color: var(--semantic-text);
  outline: none;
}

.semantic-block__rating-summary:focus-visible {
  box-shadow: 0 0 0 2px #081012, 0 0 0 4px var(--semantic-accent);
}

.semantic-block__rating-summary:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.semantic-block__rating-panel {
  position: static;
  z-index: 12;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  border: 1px solid #456b71;
  border-radius: 10px;
  padding: 10px;
  background: #0b1517;
  box-shadow: 0 12px 32px rgb(0 0 0 / 38%);
  color: #dcebed;
  font-size: 0.68rem;
  line-height: 1.4;
}

.semantic-block__rating-panel[hidden] {
  display: none;
}

.semantic-block__rating-inline {
  display: none;
}

.semantic-block__rating-inline[hidden] {
  display: none !important;
}

@container semantic-idea (min-width: 560px) {
  .semantic-block--idea {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .semantic-block--idea > .semantic-block__head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .semantic-block__rating-panel {
    position: absolute;
    width: max-content;
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
  }

  .semantic-block__rating-inline {
    display: grid;
    gap: 3px;
    margin-top: 6px;
    color: color-mix(in srgb, var(--semantic-text) 78%, transparent);
    font-size: 0.62rem;
    line-height: 1.3;
  }

  .semantic-block__rating-inline-row {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .semantic-block__rating-inline-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.semantic-block__rating-participants {
  display: grid;
  gap: 4px;
}

.semantic-block__rating-participant {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
}

.semantic-block__rating-participant > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.semantic-block__rating-own {
  border-top: 1px solid #29484d;
  padding-top: 7px;
  color: #dff4f5;
  font-weight: 850;
}

.semantic-block__rating-history-state,
.semantic-block__rating-empty {
  color: #91a7aa;
}

.semantic-block__idea-content {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: default;
  font: inherit;
  text-align: left;
}

.semantic-block__idea-footer .semantic-block__open-label {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 8px;
  background: transparent;
  color: var(--semantic-accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.semantic-block__idea-footer .semantic-block__open-label:hover,
.semantic-block__idea-footer .semantic-block__open-label:focus-visible {
  border-color: color-mix(in srgb, var(--semantic-accent) 48%, transparent);
  background: color-mix(in srgb, var(--semantic-accent) 10%, transparent);
  outline: none;
}

.semantic-block__idea-content > .semantic-block__title {
  display: block;
  min-width: 0;
  color: var(--semantic-text);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.semantic-block__idea-content > .semantic-block__text {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.semantic-block__idea-content > .semantic-block__configuration {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: color-mix(in srgb, var(--semantic-text) 72%, transparent);
  font-size: 0.68rem;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.semantic-block__idea-category {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--semantic-accent) 28%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--semantic-accent) 9%, transparent);
  color: color-mix(in srgb, var(--semantic-text) 82%, transparent);
  font-weight: 800;
}

.semantic-block__idea-purpose {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
}

.semantic-block__idea-purpose > strong {
  color: var(--semantic-accent);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.semantic-block--idea.semantic-block--work-phase {
  --semantic-work-phase: #73c9ff;
  border-inline-start: 3px solid var(--semantic-work-phase);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--semantic-work-phase) 10%, transparent),
    transparent 42%
  );
}

.semantic-block--idea[data-work-phase="LAB_DISCOVERY"] {
  --semantic-work-phase: #73c9ff;
}

.semantic-block--idea[data-work-phase="LAB_PLANNING"] {
  --semantic-work-phase: #f1b760;
}

.semantic-block--idea[data-work-phase="LAB_BLUEPRINT_READY"] {
  --semantic-work-phase: #71d7a0;
}

.semantic-block--idea[data-work-phase="FORGE_EXECUTION"] {
  --semantic-work-phase: #c49cff;
}

.semantic-block--idea[data-work-phase="RESULT_COMPLETE"] {
  --semantic-work-phase: #78e0ba;
}

.semantic-block__work-state {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--semantic-work-phase) 48%, transparent);
  border-radius: 999px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--semantic-work-phase) 11%, #081012);
  color: color-mix(in srgb, var(--semantic-work-phase) 88%, white);
  font-size: 0.65rem;
  line-height: 1.35;
}

.semantic-block__work-state > strong {
  font-weight: 850;
}

.semantic-block__work-state > span {
  color: color-mix(in srgb, var(--semantic-work-phase) 64%, #dcebed);
}

.semantic-block__idea-footer {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}

.semantic-block__reaction-chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.semantic-block__reaction-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 25px;
  border: 1px solid color-mix(in srgb, var(--semantic-accent) 30%, transparent);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgb(0 0 0 / 17%);
  color: color-mix(in srgb, var(--semantic-text) 84%, transparent);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.semantic-block__reaction-chip[data-selected="true"] {
  border-color: color-mix(in srgb, var(--semantic-accent) 75%, transparent);
  background: color-mix(in srgb, var(--semantic-accent) 18%, transparent);
  color: var(--semantic-text);
}

.semantic-block__reaction-chip[data-empty="true"] {
  background: transparent;
}

.semantic-block__engagement-footer {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
}

.semantic-block__engagement-footer > .semantic-block__metric {
  padding-inline: 0;
  background: transparent;
}

@container semantic-idea (max-width: 559px) {
  .semantic-block__engagement-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
  }
}
/* End Telegram-like Idea message card */

.semantic-message-block-shell[data-source-focus="true"] {
  display: block;
  max-width: 100%;
  scroll-margin-block: 16px;
  border-inline-start: 3px solid var(--semantic-accent, #5ed3c6);
  padding-inline-start: 8px;
}

.semantic-source-context-label {
  display: block;
  margin: 0 0 6px;
  color: var(--semantic-text);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.35;
}

.semantic-message-block-shell[data-expanded="true"] > .semantic-block {
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--semantic-accent) 35%, transparent);
}

.semantic-interaction-form {
  display: grid;
  width: min(100%, 860px);
  gap: 12px;
  margin: 8px auto 0;
  border: 1px solid #29484d;
  border-radius: 0 0 14px 14px;
  padding: 14px;
  background: #0b1416;
}

.semantic-interaction-form header,
.semantic-interaction-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.semantic-interaction-form > header {
  padding-bottom: 2px;
}

.semantic-interaction-form > header > strong {
  overflow: hidden;
  color: #e4eff0;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.semantic-interaction-form > header > button {
  border: 0;
  background: transparent;
  color: #82b9bf;
}

.semantic-interaction-form label,
.semantic-interaction-form fieldset {
  display: grid;
  min-width: 0;
  gap: 6px;
  border: 0;
  margin: 0;
  padding: 0;
  color: #a9bdc0;
  font-size: 0.72rem;
}

.semantic-interaction-form fieldset label {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.semantic-interaction-form input,
.semantic-interaction-form textarea,
.semantic-interaction-form select {
  min-width: 0;
  border: 1px solid #45656b;
  border-radius: 7px;
  padding: 7px 8px;
  background: #0a1113;
  color: #e3eeee;
  font: inherit;
}

.semantic-interaction-form textarea {
  min-height: 58px;
  resize: vertical;
}

.semantic-interaction-form button {
  border: 1px solid #4b767d;
  border-radius: 7px;
  padding: 7px 10px;
  background: #162426;
  color: #e1eeee;
  font: inherit;
  font-weight: 800;
}

.semantic-interaction-form footer button {
  background: #23613c;
}

.semantic-interaction-form__summary,
.semantic-interaction-form [data-semantic-interaction-status] {
  margin: 0;
  color: #90a7aa;
  font-size: 0.68rem;
}

.semantic-execution-contract {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid #29484d;
  border-radius: 8px;
  padding: 10px;
  background: #0d191b;
}

.semantic-execution-contract > strong {
  color: #e1eeee;
  font-size: 0.75rem;
}

.semantic-execution-contract > p {
  margin: 0;
  color: #d7b579;
  font-size: 0.7rem;
}

.semantic-execution-contract dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  margin: 0;
}

.semantic-execution-contract__fact {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 7px;
}

.semantic-execution-contract dt,
.semantic-execution-contract dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.68rem;
}

.semantic-execution-contract dt {
  color: #8fa9ac;
}

.semantic-execution-contract dd {
  color: #dcebed;
}

.semantic-execution-contract__history {
  display: grid;
  max-height: 136px;
  gap: 5px;
  margin: 0;
  overflow-y: auto;
  padding-left: 20px;
  color: #a9bdc0;
  font-size: 0.68rem;
}

.semantic-execution-contract__header {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
}

.semantic-execution-contract__header > strong {
  min-width: 0;
  color: #e1eeee;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.semantic-execution-contract__badge,
.semantic-execution-contract__state {
  border: 1px solid #3d5b60;
  border-radius: 999px;
  padding: 3px 7px;
  color: #c7dadd;
  font-size: 0.64rem;
  font-weight: 850;
  white-space: nowrap;
}

.semantic-execution-contract--task > dl {
  grid-template-columns: minmax(0, 1fr);
}

.semantic-execution-contract__technical-details {
  min-width: 0;
  border-top: 1px solid #29484d;
  padding-top: 7px;
  color: #9fb2b5;
}

.semantic-execution-contract__technical-details > summary {
  width: fit-content;
  cursor: pointer;
  color: #b8cbcd;
  font-size: 0.68rem;
  font-weight: 800;
}

.semantic-execution-contract__technical-details > summary:focus-visible {
  outline: 2px solid #6fd5d3;
  outline-offset: 3px;
}

.semantic-execution-contract__technical-details[open] {
  display: grid;
  gap: 8px;
}

.semantic-execution-contract__technical-details > strong {
  color: #c7dadd;
  font-size: 0.68rem;
}

.semantic-task-forge-link {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  border: 1px solid #2c5a60;
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #102427, #0d191b 72%);
}

.semantic-task-forge-link > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.semantic-task-forge-link span {
  color: #67d9d6;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.semantic-task-forge-link strong {
  min-width: 0;
  color: #e1eeee;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.semantic-task-forge-link__status {
  grid-column: 1 / -1;
  margin: 0;
  color: #e4b07a;
  font-size: 0.68rem;
}

@media (max-width: 620px) {
  .semantic-execution-contract__header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .semantic-execution-contract__state {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .semantic-task-forge-link {
    grid-template-columns: minmax(0, 1fr);
  }

  .semantic-task-forge-link > button {
    width: 100%;
  }
}

.semantic-lab-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  border: 1px solid color-mix(in srgb, #b69cff 42%, #29484d);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, #b69cff 8%, #0b1416);
}

.semantic-lab-transfer > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.semantic-lab-transfer > div > strong {
  color: #eadfff;
  font-size: 0.76rem;
}

.semantic-lab-transfer > div > span,
.semantic-lab-transfer__status {
  color: #9fb0b3;
  font-size: 0.66rem;
  line-height: 1.35;
}

.semantic-lab-transfer__status {
  grid-column: 1 / -1;
}

.semantic-lab-transfer--compact {
  margin-top: 6px;
  padding: 7px 9px;
  border-color: color-mix(in srgb, #4fc6b0 48%, #29484d);
  background: color-mix(in srgb, #4fc6b0 7%, #0b1416);
}

.semantic-lab-transfer--compact > div > strong {
  color: #c8f4e9;
}

.semantic-lab-transfer--compact > button {
  min-height: 36px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .semantic-lab-transfer {
    grid-template-columns: 1fr;
  }

  .semantic-lab-transfer > button,
  .semantic-lab-transfer__status {
    grid-column: 1;
  }
}

.aaa-composer--semantic-focus {
  display: none !important;
}

.semantic-inspector {
  display: none;
  border: 1px solid #3e5a60;
  border-radius: 10px;
  background: #101a1c;
}

.semantic-inspector[hidden] {
  display: none !important;
}

.semantic-inspector[data-open="true"] {
  display: block;
}

.semantic-inspector__toggle {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: transparent;
  color: #d7e5e7;
  text-align: left;
}

.semantic-inspector__toggle strong {
  flex: 1;
  font-size: 0.72rem;
}

.semantic-inspector__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid #31464b;
  padding: 9px;
}

.semantic-inspector[data-collapsed="true"] .semantic-inspector__body {
  display: none;
}

.semantic-inspector__body label {
  display: grid;
  gap: 4px;
  color: #9db1b4;
  font-size: 0.64rem;
}

.semantic-inspector__body label[data-wide="true"] {
  grid-column: 1 / -1;
}

.semantic-inspector__body input,
.semantic-inspector__body select,
.semantic-inspector__body textarea {
  min-width: 0;
  border: 1px solid #48676d;
  border-radius: 7px;
  padding: 7px 8px;
  background: #0b1214;
  color: #e5eff0;
  font: inherit;
}

.semantic-inspector__body [aria-invalid="true"] {
  border-color: #d67872;
  box-shadow: 0 0 0 2px rgb(214 120 114 / 16%);
}

.semantic-field-error {
  color: #ffaaa4;
  font-size: 0.68rem;
  line-height: 1.35;
}

.semantic-inspector__body textarea {
  min-height: 58px;
  resize: vertical;
}

.semantic-inspector__actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px;
}

.semantic-inspector__actions button {
  border: 1px solid #45656b;
  border-radius: 7px;
  padding: 6px 9px;
  background: #172326;
  color: #d9e7e8;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
}

.semantic-inspector__actions [data-action="remove"] {
  border-color: #754a4a;
  color: #ffcaca;
}

.chat-draft-preview {
  width: min(720px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  border: 1px solid #426369;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: #0f1618;
  color: #e4edef;
  box-shadow: 0 24px 80px rgb(0 0 0 / 60%);
}

.chat-draft-preview::backdrop {
  background: rgb(0 0 0 / 64%);
  backdrop-filter: blur(3px);
}

.chat-draft-preview__head,
.chat-draft-preview__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  border-bottom: 1px solid #2e4145;
  padding: 12px 14px;
}

.chat-draft-preview__footer {
  border-top: 1px solid #2e4145;
  border-bottom: 0;
}

.chat-draft-preview__body {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.chat-draft-preview__message {
  border: 1px solid #364e53;
  border-radius: 11px;
  padding: 13px;
  background: #111a1c;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-draft-preview button {
  border: 1px solid #47666c;
  border-radius: 8px;
  padding: 7px 11px;
  background: #172326;
  color: #dce9ea;
  font: inherit;
}

.message-context-menu {
  position: fixed;
  z-index: 60;
  display: none;
  min-width: 210px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  border: 1px solid #405c61;
  border-radius: 10px;
  padding: 5px;
  background: #121a1c;
  box-shadow: 0 18px 55px rgb(0 0 0 / 52%);
  overflow: auto;
}

.message-context-menu[data-open="true"] {
  display: grid;
}

.message-context-menu button {
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: transparent;
  color: #d8e5e6;
  text-align: left;
  font: inherit;
  font-size: 0.72rem;
}

.message-context-menu button:hover:not(:disabled),
.message-context-menu button:focus-visible {
  background: #213033;
  outline: none;
}

.message-context-menu button:disabled {
  color: #687b7e;
}

.message-context-menu__quick-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid #2d4347;
  padding: 2px 2px 7px;
}

.message-context-menu__quick-reaction {
  display: inline-grid;
  min-width: 38px;
  min-height: 32px;
  place-items: center;
  padding: 4px 7px !important;
  border: 1px solid #315a5f !important;
  text-align: center !important;
}

.message-context-menu__quick-reaction[aria-pressed="true"] {
  border-color: #61d7df !important;
  background: #174248 !important;
}

.message-context-menu__reaction-status {
  display: grid;
  gap: 6px;
  margin: 0;
  border-bottom: 1px solid #2d4347;
  padding: 7px 8px;
  color: #b8cbcd;
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.message-context-menu__reaction-status[hidden] {
  display: none;
}

.message-context-menu__reaction-status[data-state="pending"] {
  color: #8fded8;
}

.message-context-menu__reaction-status[data-state="error"] {
  color: #f0b4a8;
}

.message-context-menu__reaction-retry {
  min-height: 34px;
  border: 1px solid #754b45 !important;
  background: #2b1917 !important;
  color: #ffd8d0 !important;
  text-align: center !important;
}

.chat-command-message-relation {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: baseline;
  border: 0;
  border-left: 2px solid #57cbd0;
  padding: 4px 7px;
  background: #101d1f;
  color: #b9cdcf;
  text-align: left;
  font: inherit;
}

.chat-command-message-relation:hover:not(:disabled),
.chat-command-message-relation:focus-visible {
  background: #16292c;
  outline: 1px solid #315a5f;
}

.chat-command-message-relation__label {
  color: #7ed8dc;
  font-size: 0.66rem;
  white-space: nowrap;
}

.chat-command-message-relation__source {
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-body .semantic-message {
  white-space: pre-wrap;
}

.semantic-interaction-form--embedded {
  margin-top: 0;
  border-color: var(--semantic-accent, #335a60);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: color-mix(in srgb, var(--semantic-bg, #0e181a) 40%, #081012);
}

.semantic-interaction-ledger {
  display: block;
}

.semantic-interaction-ledger__group {
  display: grid;
  align-content: start;
  gap: 9px;
  border: 0;
  padding: 0;
  background: transparent;
}

.semantic-interaction-ledger__group strong,
.semantic-interaction-ledger__group > summary {
  color: #d7e6e8;
  font-size: 0.72rem;
}

.semantic-interaction-ledger__group p {
  margin: 0;
  color: #91a9ac;
  font-size: 0.66rem;
  line-height: 1.4;
}

.semantic-interaction-ledger__group--modifications {
  margin-top: 3px;
}

.semantic-interaction-ledger__group--conversation {
  gap: 12px;
}

.semantic-interaction-ledger__group--conversation > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #20383c;
  padding-bottom: 9px;
}

.semantic-interaction-ledger__group--details {
  margin-top: 8px;
  border-top: 1px solid #20383c;
  padding-top: 10px;
}

.semantic-interaction-ledger__group--details > summary {
  cursor: pointer;
  list-style: none;
}

.semantic-interaction-ledger__group--details > summary::-webkit-details-marker {
  display: none;
}

.semantic-interaction-ledger__group--details > summary::after {
  float: right;
  color: #678a8f;
  content: "＋";
}

.semantic-interaction-ledger__group--details[open] > summary::after {
  content: "−";
}

.semantic-reaction-bar {
  position: relative;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.semantic-reaction {
  min-width: 34px;
  border: 1px solid #365b62 !important;
  border-radius: 999px !important;
  padding: 3px 7px !important;
  background: #101b1d !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
}

.semantic-reaction[data-selected="true"] {
  border-color: #61d7df !important;
  background: #174248 !important;
  box-shadow: inset 0 0 0 1px rgb(97 215 223 / 22%);
}

.semantic-reaction-picker {
  position: relative;
  display: inline-flex;
}

.semantic-reaction-picker__trigger {
  width: 26px;
  min-width: 26px !important;
  height: 26px;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 0 !important;
  background: transparent !important;
  color: #789599 !important;
  font-size: 1rem !important;
}

.semantic-reaction-picker__trigger:hover,
.semantic-reaction-picker__trigger:focus-visible {
  background: #1c2d30 !important;
  color: #d8f4f6 !important;
}

.semantic-reaction-picker__menu {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 7px);
  left: 0;
  display: flex;
  gap: 3px;
  border: 1px solid #34545a;
  border-radius: 16px;
  padding: 6px;
  background: #111a1c;
  box-shadow: 0 14px 38px rgb(0 0 0 / 48%);
}

.semantic-reaction-picker__menu[hidden] {
  display: none;
}

.semantic-reaction-picker__option {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0 !important;
  border-radius: 11px !important;
  padding: 0 !important;
  background: transparent !important;
  font-size: 1rem !important;
}

.semantic-reaction-picker__option:hover,
.semantic-reaction-picker__option[data-selected="true"] {
  background: #1b3b40 !important;
}

.semantic-comment-thread {
  display: grid;
  gap: 12px;
}

.semantic-comment-thread__empty {
  color: #789195 !important;
}

.semantic-comment {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.semantic-comment__avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #365c63;
  border-radius: 50%;
  background: #13282c;
  color: #9ee4e8;
  font-size: 0.64rem;
  font-weight: 900;
}

.semantic-comment__content {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.semantic-comment > header,
.semantic-modification > header {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.semantic-comment__content > header {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.semantic-comment__content > header strong {
  color: #dce9ea;
  font-size: 0.72rem;
}

.semantic-comment__content > header time {
  margin-left: auto;
  color: #6f888c;
  font-size: 0.6rem;
}

.semantic-reaction-status {
  min-width: 9rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.semantic-answer-ledger {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.semantic-answer-ledger__empty {
  margin: 0;
  color: var(--muted);
}

.semantic-answer {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.semantic-answer > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.semantic-answer time {
  color: var(--muted);
  font-size: 0.72rem;
}

.semantic-answer p {
  margin: 0;
  white-space: pre-wrap;
}

.semantic-comment__reply-to {
  overflow: hidden;
  color: #72b7be;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.semantic-modification > header span {
  color: #728b8f;
  font-size: 0.58rem;
}

.semantic-comment__content > p,
.semantic-comment__body {
  color: #d5e4e6 !important;
  font-size: 0.72rem !important;
}

.semantic-comment__body {
  min-width: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.semantic-comment__body .semantic-message-block-shell {
  margin: 5px 0;
}

.semantic-comment__actions,
.semantic-modification__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.semantic-comment__actions > button,
.semantic-modification__actions > button {
  border: 0;
  padding: 3px 6px;
  background: transparent;
  color: #7fc8cf;
  font-size: 0.65rem;
  font-weight: 800;
}

.semantic-comment__replies {
  display: grid;
  gap: 11px;
  margin-top: 5px;
  margin-left: 3px;
  border-left: 1px solid #274247;
  padding-left: 13px;
}

.semantic-comment__replies > .semantic-comment {
  border-radius: 10px;
  padding: 7px 8px;
  background: color-mix(in srgb, #58cbd0 4%, transparent);
}

.semantic-comment__more > summary {
  cursor: pointer;
  color: #76b9c0;
  font-size: 0.66rem;
  font-weight: 800;
  list-style: none;
}

.semantic-comment__more[open] {
  display: grid;
  gap: 11px;
}

.semantic-comment-menu {
  position: relative;
  margin-left: auto;
}

.semantic-comment-menu > summary {
  cursor: pointer;
  color: #739095;
  font-size: 0.72rem;
  list-style: none;
}

.semantic-comment-menu > summary::-webkit-details-marker {
  display: none;
}

.semantic-comment-menu__body {
  position: absolute;
  z-index: 18;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  min-width: 150px;
  border: 1px solid #35545a;
  border-radius: 10px;
  padding: 5px;
  background: #111a1c;
  box-shadow: 0 14px 36px rgb(0 0 0 / 48%);
}

.semantic-comment-menu__body button {
  border: 0;
  border-radius: 7px;
  padding: 8px 9px;
  background: transparent;
  color: #d8e5e6;
  text-align: left;
  font-size: 0.68rem;
}

.semantic-comment-menu__body button:hover {
  background: #203236;
}

.semantic-modification {
  display: grid;
  gap: 8px;
  border: 0;
  border-left: 2px solid #385e65;
  border-radius: 0;
  padding: 8px 0 8px 10px;
  background: transparent;
}

.semantic-modification blockquote {
  margin: 0;
  border-left: 3px solid #69b5c0;
  padding: 7px 10px;
  background: #102326;
  color: #e0eff1;
  font-size: 0.76rem;
}

.semantic-modification__summary {
  color: #9dc0c4 !important;
  font-size: 0.68rem !important;
}

.semantic-interaction-tabs {
  display: flex;
  width: fit-content;
  gap: 6px;
  border: 1px solid #29484d;
  border-radius: 10px;
  padding: 3px;
  background: #0a1315;
}

.semantic-interaction-target {
  margin: 0;
  border-left: 3px solid #5bc6d0;
  padding: 6px 8px;
  background: #102629;
  color: #b9dfe3;
  font-size: 0.7rem;
}

.semantic-comment-composer {
  position: relative;
  display: grid;
  gap: 7px;
  border: 1px solid #31555c;
  border-radius: 14px;
  padding: 10px;
  background: #0a1416;
}

.semantic-comment-composer__hint,
.semantic-comment-composer__status {
  margin: 0;
  color: #81999d;
  font-size: 0.65rem;
  line-height: 1.4;
}

.semantic-comment-composer__editor {
  min-height: 44px;
  max-height: 160px;
  overflow: auto;
  border: 1px solid #45656b;
  border-radius: 8px;
  padding: 9px 10px;
  background: #081012;
  color: #e3eeee;
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  outline: none;
}

.semantic-comment-composer__editor:empty::before {
  color: #63797d;
  content: attr(data-placeholder);
  pointer-events: none;
}

.semantic-comment-composer__editor:focus {
  border-color: #59b9c3;
  box-shadow: 0 0 0 2px rgb(89 185 195 / 16%);
}

.semantic-comment-composer__toolbar,
.semantic-comment-composer__configuration-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.semantic-comment-composer__toolbar {
  position: absolute;
  z-index: 16;
  bottom: calc(100% + 7px);
  left: 8px;
  align-items: center;
  border: 1px solid #47767d;
  border-radius: 12px;
  padding: 5px;
  background: #101a1c;
  box-shadow: 0 14px 38px rgb(0 0 0 / 48%);
}

.semantic-comment-composer__toolbar[hidden] {
  display: none;
}

.semantic-comment-composer__selection-label {
  padding: 0 6px;
  color: #81999d;
  font-size: 0.64rem;
}

.semantic-comment-composer__toolbar button {
  padding: 5px 8px;
  border-color: transparent;
  background: transparent;
  font-size: 0.65rem;
}

.semantic-comment-composer__toolbar button:hover,
.semantic-comment-composer__toolbar button:focus-visible {
  border-color: #4a777e;
  background: #183034;
}

.semantic-comment-composer__finish-selection {
  border-color: #3e704e !important;
  background: #173322 !important;
}

.semantic-comment-composer__remove-type {
  color: #ffcaca !important;
}

.semantic-comment-composer__configuration {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid #29464c;
  padding-top: 8px;
}

.semantic-comment-composer__configuration[hidden] {
  display: none;
}

.semantic-comment-composer__configuration > strong,
.semantic-comment-composer__configuration > label:first-of-type,
.semantic-comment-composer__configuration-actions {
  grid-column: 1 / -1;
}

.semantic-comment-composer__configuration-actions button:first-child {
  background: #235a3c;
}

.semantic-comment-composer__configuration-actions button:last-child {
  border-color: #754a4a;
  color: #ffcaca;
}

.semantic-interaction-tabs button[aria-pressed="true"] {
  border-color: #55b9c4;
  background: #17383d;
  color: #efffff;
}

.semantic-interaction-tabs button:disabled {
  border-color: #314247;
  background: #11191b;
  color: #64777a;
  cursor: not-allowed;
}

.semantic-interaction-unavailable {
  margin: 0;
  border-left: 3px solid #d4a84f;
  padding: 7px 9px;
  background: #211d13;
  color: #d9c99e;
  font-size: 0.68rem;
  line-height: 1.45;
}

.semantic-interaction-panel {
  display: grid;
  gap: 8px;
}

.semantic-interaction-panel[hidden] {
  display: none;
}

/* Human-first semantic interaction mobile panel */
@media (max-width: 620px) {
  .semantic-interaction-form {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    gap: 10px;
    padding: 12px;
  }

  .semantic-interaction-form > header {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
  }

  .semantic-interaction-form > header > strong {
    overflow: visible;
    font-size: 0.82rem;
    line-height: 1.4;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .semantic-interaction-form > header > button {
    width: 100%;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
  }

  .semantic-interaction-form label,
  .semantic-interaction-form fieldset {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .semantic-interaction-form fieldset legend {
    padding: 0 0 5px;
    color: #d7e6e8;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .semantic-interaction-form fieldset label {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 7px;
  }

  .semantic-interaction-form fieldset input[type="radio"],
  .semantic-interaction-form fieldset input[type="checkbox"] {
    margin-top: 2px;
  }

  .semantic-interaction-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .semantic-interaction-tabs button {
    min-width: 0;
    min-height: 40px;
    white-space: normal;
  }

  .semantic-interaction-form footer {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
  }

  .semantic-interaction-form footer button {
    width: 100%;
    min-height: 42px;
  }

  .semantic-interaction-form__summary,
  .semantic-interaction-form [data-semantic-interaction-status],
  .semantic-interaction-target {
    font-size: 0.74rem;
    line-height: 1.45;
  }
}
/* End Human-first semantic interaction mobile panel */

@media (max-width: 900px) {
  .semantic-interaction-ledger {
    display: block;
  }

  .semantic-interaction-ledger__group--modifications {
    grid-column: auto;
  }

  .semantic-block__interaction-summary {
    flex-wrap: wrap;
  }

  .semantic-block__open-label {
    width: 100%;
    margin-left: 0;
  }

  .semantic-execution-contract dl {
    grid-template-columns: minmax(0, 1fr);
  }
}

.message-body .semantic-message > br {
  display: block;
  content: "";
  margin-top: 5px;
}

@media (max-width: 1180px) {
  .shell[data-product-mode="chat"][data-chat-rail="compact"] {
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .aaa-composer__surface {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .aaa-composer__preview {
    grid-column: 1;
  }

  .aaa-composer__submit {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
  }

  .semantic-inspector__body {
    grid-template-columns: 1fr;
  }

  .semantic-inspector__body label[data-wide="true"] {
    grid-column: 1;
  }
}

/*
 * Black Lab operational presentation layer.
 *
 * This block deliberately owns no product state. Rooms, messages, semantic
 * fragments, permissions, read state, Lab, and Forge remain rendered from the
 * existing source-bound modules. This layer only makes that truth easier to
 * scan and operate.
 */
.shell[data-ui-edition="rick"] {
  --black-lab-bg: #090d0e;
  --black-lab-rail: #0b1112;
  --black-lab-panel: #0e1415;
  --black-lab-panel-raised: #12191a;
  --black-lab-panel-strong: #182122;
  --black-lab-line: #223031;
  --black-lab-line-strong: #314647;
  --black-lab-text: #edf3f1;
  --black-lab-muted: #91a09d;
  --black-lab-quiet: #61706e;
  --black-lab-teal: #62e7d3;
  --black-lab-teal-soft: #153c38;
  --black-lab-amber: #f2ba68;
  height: 100dvh;
  min-height: 0;
  background: var(--black-lab-bg);
  color: var(--black-lab-text);
  font-size: 13px;
  letter-spacing: 0;
  transition: grid-template-columns 180ms ease;
}

@media (min-width: 761px) {
  .shell[data-ui-edition="rick"][data-workspace-mode="simple"] {
    grid-template-columns: minmax(288px, 312px) minmax(0, 1fr);
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-workspace-mode="simple"][data-chat-rail="compact"] {
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

.shell[data-ui-edition="rick"] .rooms-panel,
.shell[data-ui-edition="rick"] .conversation,
.shell[data-ui-edition="rick"] .mission-panel {
  min-height: 0;
  border-color: var(--black-lab-line);
  background: var(--black-lab-panel);
}

.shell[data-ui-edition="rick"] .rooms-panel {
  overflow: hidden;
  background: var(--black-lab-rail);
}

.shell[data-ui-edition="rick"] .rooms-panel:has(.account-control[open]) {
  overflow: visible;
}

.shell[data-ui-edition="rick"] .brand {
  min-height: 60px;
  padding: 9px 12px;
  border-color: var(--black-lab-line);
  background: var(--black-lab-rail);
}

.shell[data-ui-edition="rick"] .brand-mark,
.shell[data-ui-edition="rick"] .chat-command-kind {
  border-color: #29534e;
  border-radius: 7px;
  background: var(--black-lab-teal-soft);
  color: var(--black-lab-teal);
  box-shadow: none;
}

.shell[data-ui-edition="rick"] .brand-mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.shell[data-ui-edition="rick"] .chat-rail-toggle,
.shell[data-ui-edition="rick"] .workspace-icon-button,
.shell[data-ui-edition="rick"] .workspace-mode-toggle {
  border-color: var(--black-lab-line);
  border-radius: 7px;
  background: var(--black-lab-panel);
  color: var(--black-lab-muted);
  box-shadow: none;
}

.shell[data-ui-edition="rick"] .chat-rail-toggle:hover,
.shell[data-ui-edition="rick"] .chat-rail-toggle:focus-visible,
.shell[data-ui-edition="rick"] .workspace-icon-button:hover,
.shell[data-ui-edition="rick"] .workspace-icon-button:focus-visible {
  border-color: var(--black-lab-line-strong);
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-teal);
}

.shell[data-ui-edition="rick"] .domain-context-rail {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #263738 transparent;
  scrollbar-width: thin;
}

.shell[data-ui-edition="rick"] .chat-command-rooms {
  gap: 4px;
  padding: 10px;
}

.shell[data-ui-edition="rick"] .chat-command-room-toolbar {
  margin: 0 0 5px;
  padding-bottom: 10px;
  border-color: var(--black-lab-line);
}

.shell[data-ui-edition="rick"] .chat-command-room-search,
.shell[data-ui-edition="rick"] .chat-command-room-create__name {
  min-height: 36px;
  border-color: var(--black-lab-line);
  border-radius: 7px;
  background: var(--black-lab-panel);
  color: var(--black-lab-text);
  font-size: 12px;
}

.shell[data-ui-edition="rick"] .chat-command-room {
  min-height: 58px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
}

.shell[data-ui-edition="rick"] .chat-command-room:hover {
  border-color: var(--black-lab-line);
  background: var(--black-lab-panel);
}

.shell[data-ui-edition="rick"] .chat-command-room[aria-current="page"] {
  border-color: var(--black-lab-line-strong);
  background: #142526;
  box-shadow: inset 3px 0 0 var(--black-lab-teal);
}

.shell[data-ui-edition="rick"] .chat-command-room-avatar,
.shell[data-ui-edition="rick"] .chat-room-truth > details {
  border-color: var(--black-lab-line);
  border-radius: 7px;
  background: var(--black-lab-panel);
}

.shell[data-ui-edition="rick"] .chat-command-room-kind,
.shell[data-ui-edition="rick"] .chat-command-room-participants,
.shell[data-ui-edition="rick"] .chat-command-summary {
  color: var(--black-lab-muted);
  font-size: 11px;
}

.shell[data-ui-edition="rick"] .chat-room-truth {
  gap: 6px;
  border-color: var(--black-lab-line);
  padding: 8px 10px;
}

.shell[data-ui-edition="rick"] .chat-room-truth summary,
.shell[data-ui-edition="rick"] .rooms-footer {
  color: var(--black-lab-muted);
  font-size: 11px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .rooms-panel {
  width: 76px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-rooms {
  align-items: center;
  padding-inline: 7px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room {
  display: grid;
  width: 54px;
  min-width: 54px;
  min-height: 54px;
  grid-template: "avatar" 42px / 42px;
  place-content: center;
  padding: 5px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room > :not(.chat-command-room-avatar):not(.chat-command-room-unread):not(.chat-command-room-lock) {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-avatar {
  grid-area: avatar;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-unread {
  top: 4px;
  right: 4px;
}

.shell[data-ui-edition="rick"] .conversation,
.shell[data-ui-edition="rick"] .chat-domain-workspace,
.shell[data-ui-edition="rick"] .chat-command-main {
  min-height: 0;
  background: var(--black-lab-bg);
}

.shell[data-ui-edition="rick"] .product-mode-nav {
  min-height: 50px;
  gap: 4px;
  padding: 5px 8px 7px;
  border-color: var(--black-lab-line);
  background: var(--black-lab-rail);
}

.shell[data-ui-edition="rick"] .product-mode-nav button {
  display: grid;
  min-width: 0;
  min-height: 38px;
  grid-template-rows: 16px auto;
  place-items: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px;
  background: transparent;
  color: var(--black-lab-muted);
  text-align: center;
}

.shell[data-ui-edition="rick"] .product-mode-nav button:hover {
  border-color: var(--black-lab-line);
  background: var(--black-lab-panel);
  color: var(--black-lab-text);
}

.shell[data-ui-edition="rick"] .product-mode-nav button[aria-selected="true"] {
  border-color: #285b55;
  background: var(--black-lab-teal-soft);
  color: var(--black-lab-teal);
  box-shadow: none;
}

.shell[data-ui-edition="rick"] .product-mode-nav strong {
  font-size: 12px;
}

.shell[data-ui-edition="rick"] .product-mode-nav span {
  display: none;
}

.shell[data-ui-edition="rick"] .product-mode-nav .product-mode-glyph {
  display: inline-grid;
  place-items: center;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .product-mode-nav {
  grid-template-columns: minmax(0, 1fr);
  padding-inline: 10px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .product-mode-nav button {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 4px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .product-mode-nav strong {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .product-mode-nav .product-mode-glyph {
  display: inline-grid;
  place-items: center;
}

.shell[data-ui-edition="rick"] .domain-workspace,
.shell[data-ui-edition="rick"] .domain-content-root {
  min-height: 0;
}

.shell[data-ui-edition="rick"] .chat-domain-workspace {
  overflow: hidden;
}

.shell[data-ui-edition="rick"] .chat-domain-workspace:has(
  > .chat-selection-panel:not([hidden]),
  > .chat-contour-panel:not([hidden]),
  > .chat-work-dispatch-panel:not([hidden])
) {
  grid-template-rows: clamp(320px, 54dvh, 540px) max-content max-content max-content;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.shell[data-ui-edition="rick"] .chat-domain-workspace:has(
  > .chat-selection-panel:not([hidden]),
  > .chat-contour-panel:not([hidden]),
  > .chat-work-dispatch-panel:not([hidden])
) > .domain-content-root {
  height: 100%;
  min-height: 0;
}

.shell[data-ui-edition="rick"] .chat-command-main {
  width: 100%;
  max-width: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.shell[data-ui-edition="rick"] .chat-command-header {
  position: relative;
  z-index: 4;
  min-height: 66px;
  padding: 9px clamp(14px, 2vw, 24px);
  border-color: var(--black-lab-line);
  background: #0d1516;
}

.shell[data-ui-edition="rick"] .chat-command-kind {
  width: 40px;
  height: 40px;
}

.shell[data-ui-edition="rick"] .chat-command-title {
  color: var(--black-lab-text);
  font-size: 15px;
  letter-spacing: 0;
}

.shell[data-ui-edition="rick"] .chat-command-header .chat-command-action {
  min-height: 36px;
  border-color: #2d5e57;
  border-radius: 7px;
  background: var(--black-lab-teal-soft);
  color: var(--black-lab-teal);
  font-size: 11px;
}

.shell[data-ui-edition="rick"] .chat-command-messages {
  min-height: 0;
  gap: 10px;
  padding: 18px clamp(18px, 4vw, 64px) 16px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #0a1011;
  scrollbar-color: #283738 transparent;
  scroll-padding-block: 18px;
}

.shell[data-ui-edition="rick"] .chat-command-message-row {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: flex-end;
  gap: 8px;
}

.shell[data-ui-edition="rick"] .chat-command-messages > .chat-command-message-row:first-of-type {
  margin-top: auto;
}

.shell[data-ui-edition="rick"] .chat-command-messages:has(.semantic-interaction-form) > .chat-command-message-row:first-of-type {
  margin-top: 0;
}

.shell[data-ui-edition="rick"] .chat-command-message-row[data-ownership="own"] {
  flex-direction: row-reverse;
}

.shell[data-ui-edition="rick"] .chat-command-message-thread {
  box-sizing: border-box;
  width: calc(100% - 42px);
  margin: -2px 0 2px 42px;
  border-left: 2px solid #254743;
  padding-left: 12px;
}

.shell[data-ui-edition="rick"] .chat-command-message-thread[data-ownership="own"] {
  margin-right: 42px;
  margin-left: 0;
  border-right: 2px solid #254743;
  border-left: 0;
  padding-right: 12px;
  padding-left: 0;
}

.shell[data-ui-edition="rick"] .chat-command-message-thread__summary {
  width: fit-content;
  margin: 0 0 8px auto;
  color: var(--black-lab-teal);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.shell[data-ui-edition="rick"] .chat-command-message-thread[data-ownership="other"]
  > .chat-command-message-thread__summary {
  margin-right: auto;
  margin-left: 0;
}

.shell[data-ui-edition="rick"] .chat-command-message-thread__list {
  display: grid;
  gap: 8px;
}

.shell[data-ui-edition="rick"] .chat-command-message-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 50%;
  background: #152021;
  color: var(--black-lab-muted);
  font-size: 10px;
  font-weight: 850;
}

.shell[data-ui-edition="rick"] .chat-command-message-row[data-ownership="own"] .chat-command-message-avatar {
  border-color: #285343;
  background: #112820;
  color: var(--black-lab-teal);
}

.shell[data-ui-edition="rick"] .chat-command-empty {
  margin: auto 0 0;
  color: var(--black-lab-quiet);
  font-size: 13px;
}

.shell[data-ui-edition="rick"] .chat-command-message {
  width: min(92%, 1040px);
  gap: 7px;
  padding: 9px 38px 7px 11px;
  border-color: var(--black-lab-line);
  border-radius: 7px 7px 7px 2px;
  background: var(--black-lab-panel-raised);
  box-shadow: none;
  color: var(--black-lab-text);
  font-size: 14px;
  line-height: 1.45;
}

.shell[data-ui-edition="rick"] .chat-command-message-head,
.shell[data-ui-edition="rick"] .chat-command-message-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px 9px;
}

.shell[data-ui-edition="rick"] .chat-command-message-head {
  padding-right: 22px;
}

.shell[data-ui-edition="rick"] .chat-command-message-head > .chat-command-card-meta {
  margin-left: auto;
  color: var(--black-lab-quiet);
  font-size: 10px;
}

.shell[data-ui-edition="rick"] .message-native-agent-status {
  display: inline-flex;
  min-width: 0;
  max-width: min(100%, 320px);
  align-items: center;
  gap: 5px;
  margin: 0;
  border: 1px solid #476064;
  border-radius: 999px;
  padding: 2px 7px;
  color: #a9bec1;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"] .message-native-agent-status::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="queued"],
.shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="working"] {
  border-color: #806b35;
  color: var(--black-lab-amber);
}

.shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="working"]::before {
  animation: citadel-native-agent-live-pulse 1.1s ease-in-out infinite;
}

@keyframes citadel-native-agent-live-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="working"]::before {
    animation: none;
  }
}

.shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="responded"] {
  border-color: #2d7561;
  color: var(--black-lab-teal);
}

.shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="failed"],
.shell[data-ui-edition="rick"] .message-native-agent-status[data-tone="needs-input"] {
  border-color: #8b4d49;
  color: #f0a7a0;
}

.shell[data-ui-edition="rick"] .chat-command-message-footer {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell[data-ui-edition="rick"] .chat-command-message[data-ownership="own"] {
  border-color: #285343;
  border-radius: 7px 7px 2px;
  background: #123126;
}

.shell[data-ui-edition="rick"] .chat-command-message[data-source-focus="true"] {
  border-color: var(--black-lab-teal);
  outline-color: rgb(98 231 211 / 52%);
  box-shadow: 0 0 0 5px rgb(98 231 211 / 8%);
}

.shell[data-ui-edition="rick"] .chat-command-message-sender {
  color: var(--black-lab-amber);
  font-size: 11px;
  letter-spacing: 0;
}

.shell[data-ui-edition="rick"] .chat-command-message[data-ownership="own"] .chat-command-message-sender {
  color: var(--black-lab-teal);
}

.shell[data-ui-edition="rick"] .chat-command-message__menu,
.shell[data-ui-edition="rick"] .semantic-block,
.shell[data-ui-edition="rick"] .semantic-draft-block {
  border-radius: 6px;
  box-shadow: none;
}

.shell[data-ui-edition="rick"] .aaa-composer {
  gap: 6px;
  border-color: var(--black-lab-line);
  padding: 7px clamp(12px, 2vw, 20px) 9px;
  background: #0d1314;
  box-shadow: 0 -12px 34px rgb(0 0 0 / 16%);
}

.shell[data-ui-edition="rick"] .aaa-composer .composer-context {
  min-height: 20px;
  color: var(--black-lab-quiet);
  font-size: 10px;
}

.shell[data-ui-edition="rick"] .aaa-composer .composer-context strong,
.shell[data-ui-edition="rick"] .aaa-composer__hint-actions button {
  color: var(--black-lab-teal);
}

.shell[data-ui-edition="rick"] .aaa-composer__editor-shell {
  gap: 4px;
  border-color: var(--black-lab-line-strong);
  border-radius: 7px;
  padding: 7px 10px;
  background: #090f10;
  box-shadow: none;
}

.shell[data-ui-edition="rick"] .aaa-composer__editor-shell:focus-within {
  border-color: #2e6c62;
  box-shadow: 0 0 0 2px rgb(98 231 211 / 10%);
}

.shell[data-ui-edition="rick"] .aaa-composer__editor {
  min-height: 42px;
  max-height: 160px;
  color: var(--black-lab-text);
  font-size: 13px;
}

.shell[data-ui-edition="rick"] .aaa-composer__hint {
  color: var(--black-lab-quiet);
  font-size: 10px;
}

.shell[data-ui-edition="rick"] .aaa-composer__preview,
.shell[data-ui-edition="rick"] .aaa-composer__submit {
  min-height: 42px;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 11px;
}

.shell[data-ui-edition="rick"] .aaa-composer__preview {
  border-color: var(--black-lab-line-strong);
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-muted);
}

.shell[data-ui-edition="rick"] .aaa-composer__submit {
  border-color: #2e6c5d;
  background: #1b5a49;
  color: #effff9;
}

.shell[data-ui-edition="rick"] .semantic-selection-toolbar,
.shell[data-ui-edition="rick"] .message-context-menu {
  border-color: var(--black-lab-line-strong);
  border-radius: 7px;
  background: #121a1b;
  box-shadow: 0 18px 60px rgb(0 0 0 / 42%);
}

.shell[data-ui-edition="rick"] .message-context-menu__quick-reactions {
  display: grid;
  grid-template-columns: repeat(5, minmax(34px, 1fr));
  gap: 4px;
  border-color: var(--black-lab-line-strong);
}

.shell[data-ui-edition="rick"] .message-context-menu__quick-reaction {
  min-width: 34px;
  min-height: 34px;
  border-color: var(--black-lab-line-strong) !important;
  border-radius: 6px;
}

.shell[data-ui-edition="rick"] .message-context-menu__quick-reaction[aria-pressed="true"] {
  border-color: var(--black-lab-teal) !important;
  background: var(--black-lab-teal-soft) !important;
}

.shell[data-ui-edition="rick"] .chat-command-message-footer > .message-engagement {
  display: block;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-rating-discovery {
  display: flex;
  margin: 0;
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-rating-discovery-copy {
  display: none;
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-reactions--quick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-reactions--quick
  .message-engagement-chip[data-reaction-count="0"][aria-pressed="false"],
.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-rating-reveal {
  display: none;
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-chip,
.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-rating-reveal {
  min-width: 32px;
  min-height: 30px;
  border-color: var(--black-lab-line-strong);
  border-radius: 6px;
  background: var(--black-lab-panel);
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-disclosure:not([open]) {
  display: none;
}

.shell[data-ui-edition="rick"] .chat-command-message .message-engagement-disclosure[open] {
  margin-top: 7px;
  border-top: 1px solid var(--black-lab-line);
  padding-top: 7px;
}

.shell[data-ui-edition="rick"] .chat-command-room-context {
  min-width: 0;
  border-top: 1px solid var(--black-lab-line);
  background: #0c1213;
}

.shell[data-ui-edition="rick"] .chat-command-room-context__summary {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(14px, 2vw, 24px);
  cursor: pointer;
  color: var(--black-lab-muted);
  font-size: 11px;
  list-style: none;
}

.shell[data-ui-edition="rick"] .chat-command-room-context__summary::-webkit-details-marker {
  display: none;
}

.shell[data-ui-edition="rick"] .chat-command-room-context__summary strong {
  color: var(--black-lab-text);
}

.shell[data-ui-edition="rick"] .chat-command-room-context__summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"] .chat-command-room-context__body {
  display: grid;
  max-height: min(42vh, 420px);
  gap: 8px;
  padding: 0 clamp(14px, 2vw, 24px) 12px;
  overflow: auto;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-workspace-mode="simple"] .conversation {
  grid-template-rows: minmax(0, 1fr) auto;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-workspace-mode="simple"] #rickHumanDetails {
  display: none;
}

@media (min-width: 761px) and (max-width: 1360px) {
  .shell[data-ui-edition="rick"][data-workspace-mode="simple"] {
    grid-template-columns: 296px minmax(0, 1fr);
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-workspace-mode="simple"][data-chat-rail="compact"] {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .shell[data-ui-edition="rick"] .chat-command-messages {
    padding-inline: 28px;
  }

  .shell[data-ui-edition="rick"] .chat-command-message {
    width: min(92%, 960px);
  }
}

@media (max-width: 760px) {
  .shell[data-ui-edition="rick"] .product-mode-nav {
    min-height: 50px;
    padding-inline: 8px;
  }

  .shell[data-ui-edition="rick"] .product-mode-nav button {
    min-width: 0;
    min-height: 38px;
    padding-inline: 6px;
  }

  .shell[data-ui-edition="rick"] .chat-command-header {
    min-height: 60px;
    padding: 8px 10px;
  }

  .shell[data-ui-edition="rick"] .chat-command-messages {
    padding: 12px 10px;
  }

  .shell[data-ui-edition="rick"] .chat-command-message-row {
    gap: 6px;
  }

  .shell[data-ui-edition="rick"] .chat-command-message-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 9px;
  }

  .shell[data-ui-edition="rick"] .chat-command-message {
    width: min(88%, 620px);
    font-size: 13px;
  }

  .shell[data-ui-edition="rick"] .chat-command-message-head {
    align-items: flex-start;
  }

  .shell[data-ui-edition="rick"] .chat-command-room-context__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .shell[data-ui-edition="rick"] .aaa-composer {
    padding-inline: 8px;
  }
}

@media (max-width: 520px) {
  .shell[data-ui-edition="rick"] .aaa-composer {
    gap: 4px;
    margin-bottom: 62px;
    padding: 6px 8px 7px;
  }

  .shell[data-ui-edition="rick"] .aaa-composer .composer-context {
    min-height: 16px;
  }

  .shell[data-ui-edition="rick"] .aaa-composer .composer-context__mode {
    display: none;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__surface {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__editor-shell {
    display: contents;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__editor {
    grid-column: 1 / -1;
    min-height: 54px;
    max-height: 120px;
    border: 1px solid var(--black-lab-line-strong);
    border-radius: 7px;
    padding: 9px 10px;
    background: #090f10;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__editor:focus {
    border-color: #2e6c62;
    box-shadow: 0 0 0 2px rgb(98 231 211 / 10%);
  }

  .shell[data-ui-edition="rick"] .aaa-composer__hint {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    justify-content: flex-start;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__hint > [data-draft-kind],
  .shell[data-ui-edition="rick"] .aaa-composer__hint-actions > span {
    display: none;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__hint-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__hint-actions button {
    min-height: 36px;
    padding: 6px 8px;
    white-space: nowrap;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__preview,
  .shell[data-ui-edition="rick"] .aaa-composer__submit {
    min-height: 36px;
    grid-row: 2;
    align-self: center;
    padding: 6px 9px;
    white-space: nowrap;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__preview {
    grid-column: 2;
  }

  .shell[data-ui-edition="rick"] .aaa-composer__submit {
    grid-column: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell[data-ui-edition="rick"] {
    transition: none;
  }

  .shell[data-ui-edition="rick"] *,
  .shell[data-ui-edition="rick"] *::before,
  .shell[data-ui-edition="rick"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * Black Lab structural parity.
 *
 * Presentation only: canonical rooms, messages, receipts, capabilities,
 * membership and domain resources continue to come from existing projections.
 */
.black-lab-rail-scrim,
.chat-rail-close {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] {
  isolation: isolate;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .rooms-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .brand {
  gap: 8px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .brand-lockup > div > span {
  display: block;
  overflow: hidden;
  color: var(--black-lab-quiet);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .brand-controls {
  margin-left: auto;
}

.black-lab-identity-footer {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  border-top: 1px solid var(--black-lab-line);
  padding: 8px 10px;
  background: var(--black-lab-rail);
}

.black-lab-identity-footer .citadel-product-version {
  display: block;
  padding: 3px 8px 0;
  overflow: hidden;
  color: var(--black-lab-quiet);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"]
  .black-lab-identity-footer .citadel-product-version {
  width: 44px;
  padding-inline: 0;
  text-align: center;
  font-size: 0;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"]
  .black-lab-identity-footer .citadel-product-version::after {
  content: "α0.1";
  font-size: 9px;
}

.black-lab-identity-footer .account-control {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.black-lab-identity-footer .account-control > summary {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

.black-lab-identity-footer .account-control > summary::after {
  content: "›";
  color: var(--black-lab-muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 140ms ease;
}

.black-lab-identity-footer .account-control[open] > summary::after {
  transform: rotate(-90deg);
}

.black-lab-identity-footer .account-control > summary:hover,
.black-lab-identity-footer .account-control > summary:focus-visible,
.black-lab-identity-footer .account-control[open] > summary {
  border-color: var(--black-lab-line-strong);
  background: var(--black-lab-panel);
  outline: none;
}

.black-lab-identity-footer .account-avatar {
  width: 32px;
  height: 32px;
}

.black-lab-identity-footer .account-summary-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.black-lab-identity-footer .account-username {
  max-width: none;
  color: var(--black-lab-text) !important;
  font-size: 12px !important;
  font-weight: 750;
}

.black-lab-identity-footer .account-footer-context {
  overflow: hidden;
  color: var(--black-lab-muted);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.black-lab-identity-footer .account-popover {
  top: auto;
  right: auto;
  bottom: calc(100% + 7px);
  left: 0;
  width: min(292px, calc(100vw - 24px));
  max-height: min(70vh, 620px);
  overflow: auto;
}

.black-lab-identity-footer .account-control:not([open]) > .account-popover {
  display: none;
}

.black-lab-identity-footer .account-session-status {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--black-lab-muted);
  font-size: 10px;
}

.black-lab-identity-footer .account-session-status .status {
  width: auto;
  min-width: max-content;
  height: auto;
  min-height: 24px;
  padding: 3px 7px;
  overflow: visible;
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 999px;
  background: var(--black-lab-panel);
  box-shadow: none;
  text-overflow: clip;
}

.black-lab-identity-footer .account-settings {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--black-lab-line);
}

.black-lab-identity-footer .account-settings > summary,
.black-lab-identity-footer .account-directory > summary,
.black-lab-identity-footer .password-control > summary {
  cursor: pointer;
  color: var(--black-lab-text);
  font-size: 11px;
  font-weight: 750;
  list-style-position: inside;
}

.black-lab-identity-footer .account-settings:not([open]),
.black-lab-identity-footer .account-directory:not([open]),
.black-lab-identity-footer .password-control:not([open]) {
  padding-bottom: 0;
}

.black-lab-identity-footer .account-directory-head {
  align-items: center;
}

.black-lab-identity-footer .account-settings label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--black-lab-muted);
  font-size: 10px;
}

.black-lab-identity-footer .account-settings select {
  width: 100%;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-group {
  margin: 10px 6px 3px;
  color: var(--black-lab-quiet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-metadata-status {
  margin: 2px 8px 5px;
  overflow-wrap: anywhere;
  color: var(--black-lab-muted);
  font-size: 11px;
  line-height: 1.35;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room {
  display: grid;
  grid-template:
    "avatar name time unread" auto
    "avatar summary summary unread" auto /
    42px minmax(0, 1fr) minmax(44px, max-content) 14px;
  align-items: center;
  gap: 2px 8px;
  padding: 7px 8px;
  text-align: left;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-avatar {
  grid-area: avatar;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-name {
  min-width: 0;
  grid-area: name;
  overflow: hidden;
  color: var(--black-lab-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-summary {
  min-width: 0;
  grid-area: summary;
  overflow: hidden;
  color: var(--black-lab-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-time {
  grid-area: time;
  max-width: 72px;
  overflow: hidden;
  color: var(--black-lab-quiet);
  font-size: 9px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-unread {
  grid-area: unread;
  justify-self: center;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--pending:disabled {
  position: relative;
  border-color: #80692d;
  background: rgb(215 169 58 / 8%);
  opacity: 1;
  cursor: progress;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--pending::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d7a93a;
  content: "";
  box-shadow: 0 0 0 0 rgb(215 169 58 / 32%);
  transform: translateY(-50%);
  animation: citadel-room-pending-pulse 900ms ease-out infinite;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--pending .chat-command-room-unread {
  visibility: hidden;
}

@keyframes citadel-room-pending-pulse {
  70%,
  100% {
    box-shadow: 0 0 0 7px rgb(215 169 58 / 0%);
  }
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--locked {
  grid-template:
    "avatar name lock" auto
    "avatar summary lock" auto /
    42px minmax(0, 1fr) 18px;
  border-color: #314344;
  background: #101819;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--locked:hover,
.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--locked[aria-current="page"] {
  border-color: var(--black-lab-line-strong);
  background: #142021;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room--locked .chat-command-room-avatar {
  position: relative;
  color: var(--black-lab-muted);
  filter: saturate(.55);
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-lock {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  grid-area: lock;
  place-items: center;
  justify-self: end;
  border: 1px solid #455657;
  border-radius: 5px;
  background: #182223;
  color: #8c9a9b;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-lock::before {
  width: 8px;
  height: 7px;
  box-sizing: border-box;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  content: "";
  transform: translateY(2px);
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-room-lock::after {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 7px;
  height: 6px;
  box-sizing: border-box;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: "";
  transform: translateX(-50%);
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-room-access-terminal {
  width: min(720px, calc(100% - 32px));
  margin: auto;
  border-color: var(--black-lab-line-strong);
  background: var(--black-lab-panel);
  box-shadow: 0 24px 72px rgb(0 0 0 / 28%);
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-room-access-terminal__policy {
  color: var(--black-lab-text);
  font-weight: 700;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-room-access-terminal__privacy {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--black-lab-muted);
  font-size: 12px;
  line-height: 1.45;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .conversation {
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .conversation > :not(#chatDomainWorkspace):not(#messageForm):not(#chatRoomTruth) {
  display: none !important;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-domain-workspace,
.shell[data-ui-edition="rick"][data-product-mode="chat"] .domain-content-root,
.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-main {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-main {
  display: flex;
  flex-direction: column;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header {
  display: grid;
  grid-template-columns: 40px minmax(180px, 360px) minmax(220px, 1fr) auto;
  grid-template-areas:
    "kind title selection actions"
    "kind summary selection actions";
  align-items: center;
  column-gap: 10px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-selection-slot {
  display: grid;
  min-width: 0;
  grid-area: selection;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-selection-slot:empty {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-selection-slot .chat-selection-summary {
  width: 100%;
  min-width: 0;
  grid-area: auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-selection-slot .chat-selection-summary strong {
  min-width: 0;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header > [data-action="open_room_drawer"] {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-kind {
  grid-area: kind;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-title {
  grid-area: title;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-summary {
  min-width: 0;
  grid-area: summary;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions {
  grid-area: actions;
}

@media (min-width: 761px) {
  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header:not(:has(.chat-command-selection-slot > :not([hidden]))) {
    grid-template-columns: 40px minmax(180px, 1fr) auto;
    grid-template-areas:
      "kind title actions"
      "kind summary actions";
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header:not(:has(.chat-command-selection-slot > :not([hidden]))) .chat-command-actions {
    flex-wrap: nowrap;
  }
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="post_message"],
.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="create_poll"],
.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="record_decision"] {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-pinned-band {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--black-lab-line);
  padding: 6px clamp(14px, 2vw, 24px);
  background: #0c1415;
  color: var(--black-lab-muted);
  font-size: 11px;
  text-align: left;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-pinned-band strong {
  overflow: hidden;
  color: var(--black-lab-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector-rail {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--black-lab-line);
  padding: 7px clamp(14px, 2vw, 24px);
  background: #0b1314;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector-rail__label {
  color: #668488;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector-rail__list {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #29464a transparent;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector {
  min-height: 30px;
  flex: 0 0 auto;
  max-width: min(280px, 56vw);
  overflow: hidden;
  border: 1px solid #284247;
  border-radius: 999px;
  padding: 5px 10px;
  background: #111c1e;
  color: #94a9ac;
  font: inherit;
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector:hover,
.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector:focus-visible {
  border-color: #5e8eb8;
  color: #d9ebfb;
  outline: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector[aria-pressed="true"] {
  border-color: #6caee5;
  background: #173048;
  color: #e5f3ff;
  box-shadow: inset 0 0 0 1px rgb(108 174 229 / 18%);
}

@media (max-width: 620px) {
  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector-rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-idea-sector-rail__label {
    padding-inline: 2px;
  }
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-messages {
  flex: 1 1 auto;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-message > .chat-command-card-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-message-row--receipt {
  opacity: 0.88;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-message--receipt {
  border-style: dashed;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-message--receipt[data-publish-phase="failed"] {
  border-color: #7d3e3e;
  background: #271819;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-publish-feed-state {
  color: var(--black-lab-muted);
  font-size: 11px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-publish-feed-operation {
  color: var(--black-lab-quiet);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
}

.black-lab-room-info {
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: clamp(14px, 3vw, 28px);
  background: var(--black-lab-bg);
}

.black-lab-room-info__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.black-lab-room-info__head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.black-lab-room-info__head button {
  min-height: 38px;
  border-color: var(--black-lab-line-strong);
  border-radius: 7px;
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-text);
}

.native-team-button {
  display: inline-flex;
  min-height: 38px;
  max-width: min(330px, 40vw);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.native-team-button[hidden] {
  display: none;
}

.native-team-button > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.native-team-button__pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #829497;
}

.native-team-button[data-tone="read"] .native-team-button__pulse {
  background: var(--black-lab-teal);
}

.native-team-button[data-tone="combat"] .native-team-button__pulse {
  background: #efb85f;
  box-shadow: 0 0 0 3px rgb(239 184 95 / 14%);
}

.native-team-button[data-tone="error"] .native-team-button__pulse {
  background: #e07870;
}

.native-agent-team__intro {
  border-left: 2px solid var(--black-lab-teal);
  padding: 4px 7px;
}

.native-agent-team__connect {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--black-lab-teal);
  border-radius: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--black-lab-teal) 14%, var(--black-lab-panel));
  color: var(--black-lab-text);
  font-weight: 800;
  cursor: pointer;
}

.native-agent-team__connect:disabled {
  cursor: wait;
  opacity: 0.65;
}

.native-agent-team__error,
.native-agent-team__pending {
  margin: 0;
  border: 1px solid #744b46;
  border-radius: 7px;
  padding: 8px 9px;
  background: #281b19;
  color: #f0b4a8;
  font-size: 11px;
  line-height: 1.45;
}

.native-agent-team__pending {
  border-color: var(--black-lab-line-strong);
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-muted);
}

.native-agent-binding {
  display: grid;
  gap: 8px;
  border: 1px solid var(--black-lab-line);
  border-left: 3px solid #617174;
  border-radius: 8px;
  padding: 10px;
  background: var(--black-lab-panel);
}

.native-agent-binding[data-mode="READ"] {
  border-left-color: var(--black-lab-teal);
}

.native-agent-binding[data-mode="COMBAT"] {
  border-left-color: #efb85f;
}

.native-agent-binding__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.native-agent-binding__heading > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.native-agent-binding__heading strong {
  overflow-wrap: anywhere;
  color: var(--black-lab-text);
  font-size: 13px;
}

.native-agent-binding__heading div > span,
.native-agent-binding > p {
  margin: 0;
  color: var(--black-lab-muted);
  font-size: 11px;
  line-height: 1.45;
}

.native-agent-binding__badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.native-agent-binding__badge {
  flex: 0 0 auto;
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--black-lab-text);
  font-size: 10px;
  font-weight: 800;
}

.native-agent-binding__activity {
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--black-lab-muted);
  font-size: 10px;
  font-weight: 800;
}

.native-agent-binding__activity[data-tone="queued"],
.native-agent-binding__activity[data-tone="working"] {
  border-color: #8d7040;
  color: #f2c977;
}

.native-agent-binding__activity[data-tone="responded"] {
  border-color: #39776f;
  color: #83ddc8;
}

.native-agent-binding__activity[data-tone="failed"],
.native-agent-binding__activity[data-tone="needs-input"] {
  border-color: #744b46;
  color: #f0b4a8;
}

.native-agent-binding__profile-badge {
  border: 1px solid #39776f;
  border-radius: 999px;
  padding: 4px 8px;
  color: #83ddc8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.native-agent-binding__profile-badge[data-state="unassigned"] {
  border-color: #744b46;
  color: #f0b4a8;
  text-transform: none;
}

.native-agent-binding__identity-badge {
  border: 1px solid #56666b;
  border-radius: 999px;
  padding: 4px 8px;
  color: #9eafb2;
  font-size: 10px;
  font-weight: 800;
}

.native-agent-binding__identity-badge[data-state="verified"] {
  border-color: #6f5d8d;
  color: #c9b9ec;
}

.native-agent-binding > .native-agent-binding__activity-detail {
  color: #73888b;
  font-size: 10px;
}

.native-agent-binding__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.native-agent-binding__profile-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 0.65fr) auto;
  gap: 6px;
}

.native-agent-binding__profile-controls select,
.native-agent-binding__profile-controls button {
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-text);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.native-agent-binding__profile-controls button {
  border-color: #39776f;
  color: #83ddc8;
}

.native-agent-binding__profile-controls :disabled {
  opacity: 0.48;
}

@media (max-width: 620px) {
  .native-agent-binding__profile-controls {
    grid-template-columns: 1fr 1fr;
  }

  .native-agent-binding__profile-controls button {
    grid-column: 1 / -1;
  }
}

.native-agent-binding__controls button {
  min-height: 32px;
  border: 1px solid var(--black-lab-line-strong);
  border-radius: 7px;
  padding: 5px 10px;
  background: var(--black-lab-panel-strong);
  color: var(--black-lab-text);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.native-agent-binding__controls button[aria-pressed="true"] {
  border-color: var(--black-lab-teal);
  background: #163536;
}

.native-agent-binding__controls button:disabled:not([aria-pressed="true"]) {
  opacity: 0.42;
}

.native-agent-binding__controls .native-agent-binding__target {
  flex: 1 1 100%;
  border-color: #8d7040;
  color: #f2c977;
}

.native-agent-binding__controls .native-agent-binding__target[aria-pressed="true"] {
  border-color: #efb85f;
  background: #3a2d18;
  color: #ffe1a3;
}

.native-agent-target,
.chat-message-target {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #8d7040;
  border-radius: 8px;
  padding: 7px 9px;
  background: #251f15;
  color: #d9c8a4;
  font-size: 11px;
  line-height: 1.4;
}

.native-agent-target[hidden],
.chat-message-target[hidden] {
  display: none;
}

.native-agent-target strong,
.chat-message-target strong {
  color: #ffe1a3;
}

.native-agent-target button,
.chat-message-target button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #8d7040;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: #ffe1a3;
  font: inherit;
  font-size: 18px;
}

.chat-message-target {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  border-color: #3f6f94;
  background: #142331;
  color: #b9d1e5;
}

.chat-message-target > span:first-child,
.chat-message-target strong {
  color: #9ed3ff;
}

.chat-message-target > span:nth-child(3) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message-target button {
  border-color: #3f6f94;
  color: #9ed3ff;
}

@media (max-width: 650px) {
  .native-agent-target,
  .chat-message-target {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .native-agent-target > span:nth-child(2) {
    display: none;
  }

  .chat-message-target > span:first-child,
  .chat-message-target > span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 900px) {
  .native-team-button {
    max-width: 180px;
  }
}

@media (max-width: 650px) {
  .native-team-button > span:last-child {
    display: none;
  }

  .native-team-button {
    width: 38px;
    justify-content: center;
    padding: 7px;
  }
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .brand {
  display: grid;
  justify-items: center;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .brand-lockup {
  display: flex;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .brand-lockup > div,
.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-group,
.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer > :not(.account-control),
.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .account-summary-copy {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room-metadata-status {
  display: none;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding-inline: 7px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control,
.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control > summary {
  width: 44px;
  min-width: 44px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control > summary {
  min-height: 44px;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 5px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control > summary::after {
  display: none;
}

@media (min-width: 761px) {
  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-popover {
    right: auto;
    bottom: 0;
    left: calc(100% + 8px);
    width: min(320px, calc(100vw - 100px));
    max-height: min(78vh, 680px);
    z-index: 80;
  }
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room {
  position: relative;
  grid-template: "avatar" 42px / 42px;
}

.shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .chat-command-room--locked .chat-command-room-lock {
  display: inline-grid;
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 16px;
  height: 16px;
}

@media (min-width: 761px) {
  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-workspace-mode="simple"] {
    grid-template-columns: minmax(288px, 320px) minmax(0, 1fr);
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-workspace-mode="simple"][data-chat-rail="compact"] {
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .shell[data-ui-edition="rick"][data-product-mode="chat"] {
    position: relative;
    display: grid !important;
    width: 100vw;
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][hidden] {
    display: none !important;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-room-access-terminal {
    width: calc(100% - 20px);
    margin: 10px auto;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .conversation {
    display: grid !important;
    width: 100%;
    height: 100dvh;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .mission-panel,
  body:has(.shell[data-ui-edition="rick"][data-product-mode="chat"]:not([hidden])) .mobile-workspace-nav {
    display: none !important;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .rooms-panel {
    position: fixed;
    z-index: 120;
    top: 0;
    bottom: 0;
    left: 0;
    display: grid !important;
    width: min(86vw, 320px);
    height: 100dvh;
    border-right: 1px solid var(--black-lab-line-strong);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail-drawer="open"] .rooms-panel {
    transform: translateX(0);
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .black-lab-rail-scrim:not([hidden]) {
    position: fixed;
    z-index: 110;
    inset: 0;
    display: block;
    width: 100vw;
    height: 100dvh;
    border: 0;
    background: rgb(0 0 0 / 66%);
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-rail-close {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-color: var(--black-lab-line-strong);
    border-radius: 7px;
    background: var(--black-lab-panel);
    color: var(--black-lab-text);
    font-size: 20px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-rail-toggle {
    display: none;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control,
  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control > summary {
    width: 100%;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control > summary {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    justify-content: stretch;
    padding: 6px 8px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-control > summary::after {
    display: block;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"][data-chat-rail="compact"] .black-lab-identity-footer .account-summary-copy {
    display: grid;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header {
    min-height: auto;
    grid-template-columns: 40px 32px minmax(0, 1fr);
    grid-template-areas:
      "drawer kind title"
      "summary summary summary"
      "actions actions actions"
      "selection selection selection";
    gap: 6px 7px;
    padding: 8px 10px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-title {
    align-self: center;
    line-height: 1.25;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    gap: 6px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-selection-slot .chat-selection-summary {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "eyebrow"
      "title"
      "route"
      "action";
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-selection-slot .chat-selection-summary__action {
    min-height: 40px;
    margin-top: 4px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header > [data-action="open_room_drawer"] {
    display: inline-grid;
    min-width: 40px;
    min-height: 40px;
    grid-area: drawer;
    place-items: center;
    padding: 0;
    font-size: 0;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-header > [data-action="open_room_drawer"]::before {
    content: "☰";
    font-size: 18px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-kind {
    width: 32px;
    height: 32px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > :not([data-action="start_direct_message"]):not([data-action="show_room_members"]):not([data-action="show_native_team"]) {
    display: none;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="start_direct_message"],
  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="show_room_members"],
  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="show_native_team"] {
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 6px 5px;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="start_direct_message"]::before {
    content: "✉";
    margin-right: 4px;
    font-size: 14px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="show_room_members"]::before {
    content: "👥";
    margin-right: 4px;
    font-size: 14px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-actions > [data-action="show_native_team"]::before {
    content: "AI";
    margin-right: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -0.04em;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-pinned-band {
    padding-inline: 10px;
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .chat-command-message {
    width: min(90%, 620px);
  }

  .shell[data-ui-edition="rick"][data-product-mode="chat"] .aaa-composer {
    margin-bottom: 0;
  }

  .black-lab-room-info {
    height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell[data-ui-edition="rick"][data-product-mode="chat"] .rooms-panel {
    transition: none;
  }
}

/* Chat-owned Idea selection: a compact extension of the Black Lab feed, not a dashboard. */
.chat-selection-panel {
  margin: 0 clamp(0.75rem, 2vw, 1.5rem) 1.25rem;
}

.selection-start {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
}

.selection-start__surface {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.35rem 0;
}

.selection-start__action {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid color-mix(in srgb, var(--cyan, #52d7d2) 55%, var(--line, #294246));
  border-radius: 0.7rem;
  background: var(--surface-raised, #122024);
  color: var(--text, #e6efef);
  cursor: pointer;
  white-space: nowrap;
}

.selection-start__action:hover:not(:disabled),
.selection-start__action:focus-visible {
  border-color: var(--cyan, #52d7d2);
  outline: 2px solid color-mix(in srgb, var(--cyan, #52d7d2) 55%, transparent);
  outline-offset: 2px;
}

.selection-start__action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.selection-start__status {
  color: var(--muted, #91a4a6);
  font-size: 0.82rem;
}

.chat-contour-panel {
  margin: 0 clamp(16px, 3vw, 48px) 28px;
}

.contour-ui {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 46%, var(--line));
  border-radius: 18px;
  background: var(--panel);
}

.contour-ui__head,
.contour-ui__progress > div,
.contour-ui__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contour-ui__head h2,
.contour-ui__head p,
.contour-ui__autonomy p {
  margin: 0;
}

.contour-ui__eyebrow,
.contour-ui__next span,
.contour-ui__transport,
.contour-ui__history li span {
  color: var(--muted);
  font-size: 12px;
}

.contour-ui__state,
.contour-ui__autonomy > span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  white-space: nowrap;
}

.contour-ui__meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
}

.contour-ui__meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.contour-ui__transport {
  margin: 8px 0 0;
}

.contour-ui__next,
.contour-ui__autonomy {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.contour-ui__history summary {
  cursor: pointer;
}

.contour-ui__history ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 22px;
}

.contour-ui__history li {
  display: grid;
  gap: 2px;
}

.contour-ui__actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.contour-ui__actions button {
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: var(--text);
  background: transparent;
}

.contour-ui__actions button[data-dangerous="true"] {
  border-color: #c86a73;
  color: #ffc5ca;
}

@media (max-width: 760px) {
  .contour-ui__head,
  .contour-ui__progress > div {
    align-items: flex-start;
    flex-direction: column;
  }
}

.chat-selection-tools {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(14rem, 2fr) auto;
  gap: 0.65rem;
  align-items: end;
  margin: 0 0 0.75rem;
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--cyan, #52d7d2) 32%, var(--line, #294246));
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--surface, #0d1719) 88%, transparent);
}

.chat-selection-tools label {
  color: var(--muted, #91a4a6);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-selection-tools select,
.chat-selection-tools button {
  min-height: 2.6rem;
  border: 1px solid var(--line, #294246);
  border-radius: 0.7rem;
  background: var(--surface-raised, #122024);
  color: var(--text, #e6efef);
}

.chat-selection-tools button {
  padding: 0.65rem 1rem;
  border-color: color-mix(in srgb, var(--cyan, #52d7d2) 55%, var(--line, #294246));
  cursor: pointer;
}

.chat-selection-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.chat-selection-tools [role="status"] {
  grid-column: 1 / -1;
  min-height: 1.1rem;
  color: var(--muted, #91a4a6);
  font-size: 0.82rem;
}

.selection-ui {
  min-width: 0;
  color: var(--black-lab-text, #e6efef);
}

.selection-ui__surface {
  display: grid;
  width: min(100%, 980px);
  min-width: 0;
  gap: 10px;
  margin: 0 auto;
  padding: 12px;
}

.selection-ui__collapsed-summary {
  display: flex;
  min-height: 52px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #6a5937;
  border-radius: 12px;
  background: #181c19;
  color: #eef8f8;
  cursor: pointer;
  list-style-position: inside;
}

.selection-ui__collapsed-summary::marker {
  color: var(--cyan);
}

.selection-ui__collapsed-summary-action {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.selection-ui__collapsed-summary-state {
  margin-left: auto;
  color: #8fa4a6;
  font-size: 0.72rem;
}

.selection-ui__surface[open] > .selection-ui__collapsed-summary {
  margin-bottom: 2px;
  border-color: color-mix(in srgb, var(--cyan) 45%, #6a5937);
}

details.selection-ui__surface:not([open]) > :not(summary) {
  display: none;
}

.selection-ui__human-path {
  display: grid;
  min-width: 0;
  gap: 4px;
  border-left: 3px solid var(--cyan, #52d7d2);
  border-radius: 9px;
  padding: 10px 12px;
  background: #111b1d;
}

.selection-ui__human-path h3,
.selection-ui__human-path p {
  margin: 0;
  overflow-wrap: anywhere;
}

.selection-ui__human-path h3 {
  color: #e8f5f5;
  font-size: 0.92rem;
}

.selection-ui__human-path p {
  color: #9db0b2;
  font-size: 0.74rem;
  line-height: 1.45;
}

.selection-ui__technical-details {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #2b3b3e;
  border-radius: 9px;
  background: #0e1517;
}

.selection-ui__technical-details > summary {
  min-height: 40px;
  padding: 9px 11px;
  color: #91a4a6;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
}

.selection-ui__technical-details > summary:focus-visible {
  outline: 2px solid #f0c46f;
  outline-offset: -2px;
}

.selection-ui__technical-body {
  display: grid;
  min-width: 0;
  gap: 8px;
  border-top: 1px solid #2b3b3e;
  padding: 9px;
}

.selection-ui__technical-group,
.selection-ui__technical-record {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.selection-ui__technical-group + .selection-ui__technical-group,
.selection-ui__technical-record + .selection-ui__technical-record {
  border-top: 1px solid #263639;
  padding-top: 8px;
}

.selection-ui__technical-group h4 {
  margin: 0;
  color: #b7c8ca;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.selection-ui__technical-details .selection-ui__fact {
  grid-template-columns: minmax(112px, 0.28fr) minmax(0, 1fr);
  padding: 5px 7px;
}

.selection-ui__lifecycle {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selection-ui__lifecycle-stage {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid #263639;
  border-radius: 8px;
  background: #11191b;
  color: #789093;
}

.selection-ui__lifecycle-stage[data-stage-state="complete"] {
  border-color: #2f614f;
  color: #9ed7b5;
}

.selection-ui__lifecycle-stage[data-stage-state="current"] {
  border-color: var(--cyan);
  background: #142a2c;
  color: #e6ffff;
}

.selection-ui__lifecycle-index {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #203336;
  font-size: 0.65rem;
  font-weight: 900;
}

.selection-ui__lifecycle-label {
  overflow-wrap: anywhere;
  font-size: 0.69rem;
  font-weight: 800;
}

.selection-ui__lifecycle-detail {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: #8fa4a6;
  font-size: 0.72rem;
}

.selection-ui__header,
.selection-ui__section-head,
.selection-ui__candidate-head,
.selection-ui__qualification-summary,
.selection-ui__winner-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.selection-ui__header,
.selection-ui__candidates,
.selection-ui__commands,
.selection-ui__shortlist,
.selection-ui__ballot,
.selection-ui__winner,
.selection-ui__terminal {
  min-width: 0;
  border: 1px solid var(--black-lab-line, #2c3c3f);
  border-radius: 12px;
  background: var(--black-lab-panel, #101719);
  box-shadow: 0 12px 38px rgb(0 0 0 / 14%);
}

.selection-ui__header,
.selection-ui__candidates,
.selection-ui__commands,
.selection-ui__shortlist,
.selection-ui__ballot,
.selection-ui__winner,
.selection-ui__terminal {
  padding: 12px;
}

.selection-ui__heading {
  min-width: 0;
}

.selection-ui__heading h2,
.selection-ui__section-head h3,
.selection-ui__commands h3,
.selection-ui__shortlist h3,
.selection-ui__candidate h4,
.selection-ui__ballot h3,
.selection-ui__winner h3,
.selection-ui__terminal h3 {
  margin: 0;
  color: #eef8f8;
  overflow-wrap: anywhere;
}

.selection-ui__heading h2 {
  margin-top: 3px;
  font-size: 1.08rem;
}

.selection-ui__heading p,
.selection-ui__ballot-deadline,
.selection-ui__winner-head p,
.selection-ui__terminal p,
.selection-ui__lab-result p,
.selection-ui__candidate-debate {
  margin: 5px 0 0;
  color: #8fa4a6;
  line-height: 1.45;
}

.selection-ui__candidate-debate {
  font-size: 0.72rem;
}

.semantic-task-lifecycle {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 10px 0;
}

.semantic-task-lifecycle__stages {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.semantic-task-lifecycle__stage {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #2a3a3d;
  border-radius: 7px;
  background: #11191b;
  color: #708689;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.semantic-task-lifecycle__stage[data-stage-state="observed"] {
  border-color: #2f614f;
  background: #13251e;
  color: #9ed7b5;
}

.semantic-task-lifecycle__stage[data-stage-state="current"] {
  border-color: var(--cyan);
  background: #153033;
  color: #e7ffff;
}

.semantic-task-lifecycle[data-blocked="true"]
  .semantic-task-lifecycle__stage[data-stage-state="current"] {
  border-color: #bd735f;
  background: #38221e;
  color: #ffd0c3;
}

.semantic-task-lifecycle__blocked {
  width: fit-content;
  margin: 0;
  border: 1px solid #a96050;
  border-radius: 999px;
  padding: 3px 7px;
  background: #30201d;
  color: #ffc8bb;
  font-size: 0.68rem;
  font-weight: 850;
}

.semantic-task-lifecycle__elapsed {
  margin: 0;
  color: #91a4a6;
  font-size: 0.72rem;
}

.semantic-task-lifecycle--compact {
  flex: 1 1 100%;
  margin: 3px 0 0;
}

.semantic-task-lifecycle--compact .semantic-task-lifecycle__stage {
  padding: 3px 6px;
  font-size: 0.58rem;
}

.semantic-task-lifecycle--compact .semantic-task-lifecycle__elapsed {
  font-size: 0.61rem;
}

.selection-ui__eyebrow {
  color: var(--black-lab-teal, #72dedb);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.selection-ui__state-badge,
.selection-ui__candidate-state,
.selection-ui__round-state,
.selection-ui__section-count {
  flex: 0 0 auto;
  border: 1px solid #3d5a5d;
  border-radius: 999px;
  padding: 4px 7px;
  background: #152124;
  color: #c8dcdd;
  font-size: 0.65rem;
  font-weight: 850;
}

.selection-ui__contract,
.selection-ui__candidate-meta,
.selection-ui__winner-facts,
.selection-ui__ballot-facts,
.selection-ui__qualification-metrics,
.selection-ui__tally {
  display: grid;
  min-width: 0;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #263639;
  border-radius: 8px;
  background: #263639;
}

.selection-ui__winner-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selection-ui__fact {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 7px 8px;
  background: #11191b;
}

.selection-ui__fact-label {
  color: #789093;
  font-size: 0.61rem;
  font-weight: 750;
}

.selection-ui__fact-value {
  color: #dce9e9;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.selection-ui__section-head {
  align-items: center;
}

.selection-ui__candidate-list {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin-top: 9px;
}

.selection-ui__candidate {
  min-width: 0;
  border: 1px solid #2d4245;
  border-left: 3px solid #66cfce;
  border-radius: 9px;
  padding: 10px;
  background: #121b1d;
}

.selection-ui__candidate[data-candidate-state="winner"] {
  border-color: #d8ad58;
  border-left-color: #f2c56d;
  background: #191e1b;
}

.selection-ui__candidate[data-candidate-state="qualified"] {
  border-left-color: #79cf94;
}

.selection-ui__candidate[data-candidate-state="eliminated"],
.selection-ui__candidate[data-candidate-state="superseded"] {
  border-left-color: #596a6c;
}

.selection-ui__candidate-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.selection-ui__candidate-rank {
  color: #a7c8ca;
  font-size: 0.65rem;
  font-weight: 800;
}

.selection-ui__candidate-excerpt,
.selection-ui__empty,
.selection-ui__notice,
.selection-ui__own-ballot {
  margin: 8px 0 0;
  color: #a8b9bb;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.selection-ui__idea-link,
.selection-ui__action,
.selection-ui__ballot-choice {
  min-height: 40px;
  border: 1px solid #3a6367;
  border-radius: 8px;
  padding: 7px 10px;
  background: #152426;
  color: #d9f1f1;
  font: inherit;
  font-weight: 780;
  touch-action: manipulation;
}

.selection-ui__idea-link {
  margin-top: 8px;
}

.selection-ui__idea-link:hover:not(:disabled),
.selection-ui__action:hover:not(:disabled),
.selection-ui__ballot-choice:hover:not(:disabled),
.selection-ui__ballot-choice[aria-pressed="true"] {
  border-color: #70d7d5;
  background: #1a3234;
}

.selection-ui__idea-link:focus-visible,
.selection-ui__action:focus-visible,
.selection-ui__ballot-choice:focus-visible {
  outline: 2px solid #f0c46f;
  outline-offset: 2px;
}

.selection-ui__qualification {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  border-top: 1px solid #2a3a3d;
  padding-top: 9px;
}

.selection-ui__qualification-summary {
  align-items: center;
}

.selection-ui__qualification-summary strong {
  color: #8edba4;
  font-size: 0.75rem;
}

.selection-ui__qualification[data-qualification-state="ineligible"] .selection-ui__qualification-summary strong {
  color: #e5aa7a;
}

.selection-ui__qualification-summary span {
  color: #819698;
  font-size: 0.66rem;
}

.selection-ui__qualification-reasons,
.selection-ui__shortlist-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
  color: #9eb1b2;
  font-size: 0.69rem;
  line-height: 1.4;
}

.selection-ui__shortlist[data-shortlist-state="needs_input"],
.selection-ui__lab-result[data-lab-state="rejected"],
.selection-ui__lab-result[data-lab-state="needs_reformulation"] {
  border-color: #7a6238;
  background: #1d1c17;
}

.selection-ui__notice {
  border-left: 2px solid #5ca8aa;
  padding: 7px 9px;
  background: #122022;
}

.selection-ui__notice--hold {
  border-left-color: #e0af5c;
  background: #211e17;
  color: #e6c68f;
}

.selection-ui__action-shell {
  display: inline-grid;
  min-width: 0;
  gap: 4px;
  margin: 8px 6px 0 0;
  vertical-align: top;
}

.selection-ui__action-reason {
  max-width: 240px;
  color: #87999b;
  font-size: 0.62rem;
  line-height: 1.35;
}

.selection-ui__commands-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px;
}

.selection-ui__action:disabled,
.selection-ui__ballot-choice:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.selection-ui__ballot-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.selection-ui__ballot-choices {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.selection-ui__ballot-choice {
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

.selection-ui__ballot-choice--abstain {
  border-style: dashed;
  color: #aebfc0;
}

.selection-ui__winner {
  border-color: #6a5937;
  background: #181c19;
}

.selection-ui__winner-head {
  display: grid;
  justify-content: stretch;
}

.selection-ui__lab-result {
  margin-top: 10px;
  border: 1px solid #344a4d;
  border-radius: 9px;
  padding: 10px;
  background: #10191b;
}

.selection-ui__lab-result > strong {
  color: #bde1e2;
}

.selection-ui__rejection-actions {
  margin-top: 8px;
}

.selection-ui__terminal {
  width: min(calc(100% - 24px), 720px);
  margin: 12px auto;
}

.selection-ui__terminal--error {
  border-color: #874e4e;
}

.selection-ui__terminal--visible_locked {
  border-color: #59676a;
}

.selection-ui__terminal--loading {
  border-color: #3c6669;
}

@media (max-width: 900px) {
  .selection-ui__contract,
  .selection-ui__candidate-meta,
  .selection-ui__winner-facts,
  .selection-ui__ballot-facts,
  .selection-ui__qualification-metrics,
  .selection-ui__tally {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px), (pointer: coarse) {
  .chat-selection-tools {
    grid-template-columns: 1fr;
  }

  .chat-selection-tools [role="status"] {
    grid-column: 1;
  }

  .selection-ui__surface {
    padding: 8px;
  }

  .selection-ui__header,
  .selection-ui__candidate-head,
  .selection-ui__qualification-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-ui__ballot-choices {
    grid-template-columns: 1fr;
  }

  .selection-ui__idea-link,
  .selection-ui__action,
  .selection-ui__ballot-choice {
    min-height: 44px;
  }

  .selection-ui__action-shell {
    width: 100%;
    margin-right: 0;
  }

  .selection-ui__action {
    width: 100%;
  }

  .selection-ui__technical-details .selection-ui__fact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .selection-ui__contract,
  .selection-ui__candidate-meta,
  .selection-ui__winner-facts,
  .selection-ui__ballot-facts,
  .selection-ui__qualification-metrics,
  .selection-ui__tally {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .selection-ui *,
  .selection-ui *::before,
  .selection-ui *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.lab-evaluation-ui {
  --lab-evaluation-accent: #62d9d2;
  --lab-evaluation-line: color-mix(in srgb, var(--lab-evaluation-accent) 30%, var(--line));
  width: 100%;
  min-width: 0;
  padding: clamp(12px, 2vw, 24px);
}

.lab-evaluation-ui__surface,
.lab-evaluation-ui__terminal {
  display: grid;
  gap: 16px;
  width: min(100%, 1040px);
  margin-inline: auto;
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid var(--lab-evaluation-line);
  border-radius: 16px;
  background: #0e1719;
  box-shadow: 0 22px 70px rgb(0 0 0 / 24%);
}

.lab-evaluation-ui__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 18px;
  align-items: start;
}

.lab-evaluation-ui__heading h2,
.lab-evaluation-ui__heading p {
  margin: 0;
}

.lab-evaluation-ui__heading h2 {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.025em;
}

.lab-evaluation-ui__heading p {
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.55;
}

.lab-evaluation-ui__eyebrow {
  grid-column: 1 / -1;
  color: var(--lab-evaluation-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.lab-evaluation-ui__state {
  grid-column: 2;
  grid-row: 2 / span 2;
  padding: 7px 10px;
  border: 1px solid var(--lab-evaluation-line);
  border-radius: 999px;
  color: var(--lab-evaluation-accent);
  background: rgb(81 208 210 / 8%);
  font-size: 11px;
  font-weight: 800;
}

.lab-evaluation-ui__notice,
.lab-evaluation-ui__falsifier {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--amber);
  color: #dbe5e3;
  background: rgb(239 184 79 / 7%);
  line-height: 1.5;
}

.lab-evaluation-ui__facts,
.lab-evaluation-ui__contract,
.lab-evaluation-ui__links,
.lab-evaluation-ui__history,
.lab-evaluation-ui__verdict,
.lab-evaluation-ui__decision {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(8 13 15 / 44%);
}

.lab-evaluation-ui__facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lab-evaluation-ui__fact {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lab-evaluation-ui__fact span {
  color: var(--muted);
  font-size: 11px;
}

.lab-evaluation-ui__fact strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.lab-evaluation-ui__contract h3,
.lab-evaluation-ui__links h3,
.lab-evaluation-ui__history h3,
.lab-evaluation-ui__verdict h3,
.lab-evaluation-ui__decision h3 {
  margin: 0;
  font-size: 14px;
}

.lab-evaluation-ui__criteria {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #dfe8e6;
}

.lab-evaluation-ui__links {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.lab-evaluation-ui__links h3 {
  grid-column: 1 / -1;
}

.lab-evaluation-ui__link {
  min-height: 42px;
  overflow: hidden;
  border-color: var(--lab-evaluation-line);
  background: rgb(81 208 210 / 8%);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-evaluation-ui__history-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.lab-evaluation-ui__history-row[data-current="true"] {
  border-color: var(--lab-evaluation-line);
  color: var(--text);
  background: rgb(81 208 210 / 6%);
}

.lab-evaluation-ui__reason {
  min-height: 112px;
}

.lab-evaluation-ui__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-evaluation-ui__actions button {
  flex: 1 1 190px;
}

.lab-evaluation-ui__actions button[value="REJECTED"] {
  border-color: color-mix(in srgb, var(--red) 60%, var(--line));
  background: rgb(237 109 104 / 14%);
}

@media (max-width: 760px) {
  .lab-evaluation-ui {
    padding: 10px;
  }

  .lab-evaluation-ui__heading,
  .lab-evaluation-ui__facts {
    grid-template-columns: 1fr;
  }

  .lab-evaluation-ui__state {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .lab-evaluation-ui__history-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .lab-evaluation-ui__history-row span:last-child {
    grid-column: 1 / -1;
  }
}

.chat-work-dispatch-panel {
  margin: 14px 20px 24px;
  border: 1px solid color-mix(in srgb, var(--cyan) 28%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, #0b1819);
  overflow: hidden;
}

.chat-work-dispatch-panel__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.chat-work-dispatch-panel__head h2,
.work-dispatch-ui h2,
.work-dispatch-ui h3,
.work-dispatch-ui h4,
.work-dispatch-ui p,
.work-dispatch-ui dl {
  margin: 0;
}

.chat-work-dispatch-panel__head p {
  max-width: 580px;
  color: var(--muted);
}

.work-dispatch-ui__surface {
  display: grid;
  gap: 18px;
  padding: 18px 20px 22px;
}

.work-dispatch-ui__eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.work-dispatch-ui__options,
.work-dispatch-ui__dispatches {
  display: grid;
  gap: 10px;
}

.work-dispatch-ui__option,
.work-dispatch-ui__dispatch {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(4 17 18 / 52%);
}

.work-dispatch-ui__dispatch[data-dispatch-state="DELIVERED"] {
  border-color: rgb(79 213 142 / 45%);
}

.work-dispatch-ui__dispatch[data-dispatch-state="FAILED"] {
  border-color: rgb(237 109 104 / 52%);
}

.work-dispatch-ui__dispatch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.work-dispatch-ui__state {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--cyan) 35%, var(--line));
  border-radius: 999px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.work-dispatch-ui__facts {
  display: grid;
  grid-template-columns: minmax(90px, .32fr) minmax(0, 1fr);
  gap: 6px 14px;
}

.work-dispatch-ui__facts dt,
.work-dispatch-ui__packet-meta,
.work-dispatch-ui__provenance,
.work-dispatch-ui__empty,
.work-dispatch-ui__terminal {
  color: var(--muted);
}

.work-dispatch-ui__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.work-dispatch-ui__actor,
.work-dispatch-ui__summary {
  color: var(--muted);
}

.work-dispatch-ui__technical {
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.work-dispatch-ui__technical > summary {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.work-dispatch-ui__technical[open] {
  display: grid;
  gap: 12px;
}

.work-dispatch-ui__technical[open] > summary {
  color: var(--cyan);
}

.work-dispatch-ui__provenance-detail {
  display: grid;
  gap: 6px;
}

.work-dispatch-ui__packet,
.work-dispatch-ui__next,
.work-dispatch-ui__delivery {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 11px;
  background: rgb(81 208 210 / 6%);
}

.work-dispatch-ui__falsifier {
  color: color-mix(in srgb, var(--warning) 78%, var(--text));
}

.work-dispatch-ui__next span {
  color: var(--muted);
  font-size: 12px;
}

.work-dispatch-ui__delivery {
  border-left: 3px solid var(--green);
}

.work-dispatch-ui button {
  justify-self: start;
  min-height: 40px;
}

.work-dispatch-ui__terminal-reason {
  color: var(--red);
}

@media (max-width: 760px) {
  .chat-work-dispatch-panel {
    margin: 10px;
  }

  .chat-work-dispatch-panel__head {
    align-items: start;
    flex-direction: column;
  }

  .work-dispatch-ui__facts {
    grid-template-columns: 1fr;
  }
}

/* Canonical score and acknowledgement projections own presentation only. */
.semantic-score-state {
  display: grid;
  gap: 7px;
  border: 1px solid #31565c;
  border-radius: 9px;
  padding: 10px;
  background: #0c1719;
}

.semantic-score-state p,
.semantic-score-replacement p,
.message-readers-dialog__truth p {
  margin: 0;
}

.semantic-score-state__summary {
  color: #dcebec;
  font-weight: 800;
}

.semantic-score-state__summary[data-state="loading"] {
  color: #a9bdc0;
}

.semantic-score-state__summary[data-state="error"],
.message-readers-list__empty[data-state="error"] {
  color: #ffc0bd;
}

.semantic-score-state__own,
.semantic-score-history {
  color: #a9bdc0;
}

.semantic-score-state__participants {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.semantic-score-state__participants li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #29484d;
  padding-top: 5px;
  color: #c7dcdf;
  font-size: 0.72rem;
}

.semantic-interaction-form__outcome {
  margin: 0;
  border-left: 3px solid #43c58a;
  padding: 8px 10px;
  background: #10251d;
  color: #d7f5e7;
}

.semantic-score-history > summary {
  min-height: 32px;
  padding: 6px 0;
  color: #75cad2;
  cursor: pointer;
}

.semantic-score-history p {
  border-top: 1px solid #29484d;
  padding: 7px 0;
  overflow-wrap: anywhere;
  font-size: 0.68rem;
  line-height: 1.45;
}

.semantic-score-replacement {
  display: grid;
  gap: 8px;
  border-left: 3px solid #d8a95d;
  padding: 9px 10px;
  background: #19170f;
}

.semantic-score-replacement[hidden] {
  display: none;
}

.message-readers-dialog__truth {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border-top: 1px solid #29484d;
  padding-top: 16px;
}

.message-readers-dialog__truth > p {
  color: #a9bdc0;
  font-size: 0.78rem;
}

.message-readers-list__truth-row .message-readers-list__status {
  max-width: 300px;
  text-align: right;
}

.message-readers-list__status[data-state="acknowledged"] {
  color: #75d69a;
}

.message-readers-list__status[data-state="unknown"] {
  color: #d3b37a;
}

.message-readers-dialog__acknowledge {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.message-readers-dialog__acknowledge button {
  min-height: 44px;
  flex: 0 0 auto;
}

.message-readers-dialog__acknowledge span {
  min-width: 0;
  color: #a9bdc0;
  overflow-wrap: anywhere;
}

.message-readers-dialog__acknowledge span[role="alert"] {
  color: #ffc0bd;
}

@media (max-width: 760px) {
  .black-lab-identity-footer .account-popover {
    position: fixed;
    inset: 12px 12px auto;
    width: auto;
    max-height: calc(100dvh - 24px);
    overscroll-behavior: contain;
  }

  .message-readers-dialog__truth {
    grid-column: auto;
  }

  .message-readers-list__row,
  .message-readers-list__truth-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .message-readers-list__row .message-readers-list__status,
  .message-readers-list__truth-row .message-readers-list__status,
  .message-readers-list__row .direct-message-action {
    grid-column: 2;
    justify-self: start;
    max-width: none;
    text-align: left;
  }

  .message-readers-dialog__acknowledge {
    align-items: stretch;
    flex-direction: column;
  }

  .message-readers-dialog__acknowledge button {
    width: 100%;
  }
}
