.talk-home {
  max-width: 100%;
}

.talk-home .aml-segment {
  width: 100%;
  max-width: 100%;
}

.talk-home .aml-segment a {
  min-width: 0;
  flex: 1 1 0;
  white-space: normal;
  text-align: center;
}

.talk-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: var(--space-3);
}

.talk-head {
  margin-bottom: var(--space-3);
}

.talk-head p,
.talk-people {
  color: var(--color-text-2);
  margin: 0 0 var(--space-2);
}

.talk-people {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.talk-split {
  display: grid;
  gap: var(--space-4);
}

.talk-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: 12rem;
}

.talk-body,
.talk-quote {
  overflow-wrap: anywhere;
}

.talk-quote {
  color: var(--color-text-2);
  margin: 0;
}

.talk-composer {
  position: sticky;
  bottom: 4.75rem;
  z-index: 4;
  background: var(--color-bg);
  padding-top: var(--space-3);
}

.talk-mentions,
.talk-emoji,
.talk-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.talk-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.talk-photo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  max-width: 100%;
  scroll-margin-bottom: 16rem;
}

.talk-comment,
.talk-bubble {
  scroll-margin-bottom: 16rem;
}

.talk-media,
.talk-photo img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.talk-photo img {
  min-width: 44px;
  min-height: 44px;
  object-fit: cover;
}

.talk-notice {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  margin-bottom: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  min-height: 44px;
}

.talk-notice .aml-row {
  margin: 0;
  border: 0;
  background: transparent;
  padding-bottom: var(--space-2);
}

.talk-notice p {
  margin: 0;
  padding: 0 var(--space-4) var(--space-4);
  color: var(--color-text-2);
}

.talk-topic {
  margin-bottom: var(--space-3);
}

.talk-reactions button,
.aml-reactions button,
.talk-action {
  min-height: 44px;
  min-width: 44px;
}

.talk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  flex: 1 1 100%;
}

.talk-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-2);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.talk-action:hover,
.talk-action:focus-visible {
  color: var(--color-text);
}

.talk-action:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.talk-react-chip[aria-pressed="true"] {
  color: var(--color-text);
  background: var(--color-surface);
}

.talk-gif-react {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.talk-gif-search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: end;
  margin-bottom: var(--space-3);
}

.talk-gif-search .aml-field {
  flex: 1 1 12rem;
  margin: 0;
}

.talk-gif-thumb {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 5rem;
  padding: var(--space-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface-sunk);
  color: var(--color-text);
  text-align: start;
  cursor: pointer;
}

.talk-gif-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.talk-gif-thumb span {
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talk-action-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}


@media (min-width: 960px) {
  .talk-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .talk-composer {
    bottom: var(--space-4);
  }
}

/* V-1d: flat messages, one-pixel thread lines, pill reactions and a one-row composer. */
.talk-log { gap: var(--space-1); }

.talk-log article {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
}

.talk-log article > p,
.talk-log article > .talk-actions { flex: 1 1 100%; margin: 0; }

.talk-log article > .talk-media {
  flex: 0 1 auto;
  margin: 0;
  width: min(100%, 20rem);
  max-height: 14rem;
  height: auto;
  object-fit: contain;
  background: var(--color-surface-sunk);
}

.talk-log article > p:first-child { font-size: var(--text-sm); color: var(--color-text-2); }

.talk-log .talk-bubble {
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: 0 var(--space-6) var(--space-1) 0;
}

.talk-log .talk-bubble.aml-bubble--mine {
  background: var(--color-surface-raised);
  margin: 0 0 var(--space-1) var(--space-6);
}

.talk-log .talk-comment {
  background: none;
  border: 0;
  border-left: 1px solid var(--color-line);
  border-radius: 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  margin: 0 0 0 calc(var(--depth, 0) * var(--space-4));
}

.talk-log .aml-reactions {
  flex: 1 1 auto;
  gap: var(--space-1);
}

.aml-reactions button,
.talk-log .rest-menu > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-2);
  border: 8px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  background-clip: padding-box;
  color: var(--color-text-2);
  font: inherit;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.aml-reactions button:hover,
.talk-log .rest-menu > button:hover { color: var(--color-text); }

.aml-reactions button:focus-visible,
.talk-log .rest-menu > button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: -6px;
}

/* One row: media buttons at the left, the growing field, send at the right. */
.talk-composer {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
  border-top: 1px solid var(--color-line);
}

.talk-composer > p,
.talk-composer > .talk-mentions,
.talk-composer > .aml-btn--quiet:not(.talk-attach) { grid-column: 1 / -1; order: -1; justify-self: start; margin: 0; }

.talk-composer .aml-composer__tools { display: contents; }
.talk-composer .talk-attach { grid-column: 1; order: 1; }
.talk-composer .aml-composer__tools > .aml-btn--quiet:not(.talk-attach) { grid-column: 2; order: 2; }
.talk-composer > .aml-field { grid-column: 3; order: 3; min-width: 0; }
.talk-composer .aml-composer__tools > [type="submit"] { grid-column: 4; order: 4; }

.talk-composer .aml-field { margin: 0; }
.talk-composer .aml-field > label,
.talk-composer .aml-counter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.talk-composer textarea {
  field-sizing: content;
  min-height: 44px;
  max-height: 8rem;
  resize: none;
}

.talk-composer .aml-btn { min-width: 44px; min-height: 44px; padding-inline: var(--space-3); }
.talk-attach { cursor: pointer; }

/* Lists: quiet rows with a divider, no cards. */
.talk-list .aml-row,
.talk-list .talk-notice {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  border-radius: 0;
  margin: 0;
  padding: var(--space-4) 0;
}

.talk-list .talk-notice .aml-row { border-bottom: 0; padding-bottom: var(--space-1); }
.talk-list .talk-notice p { padding: 0 0 var(--space-3); }
.talk-list .rest-row,
.talk-list .rest-topic { position: relative; }
.talk-list .rest-dot { position: absolute; top: var(--space-4); right: 0; margin: 0; }
.talk-list .aml-row header { display: flex; align-items: center; gap: var(--space-2); }
.talk-list .aml-row p { color: var(--color-text-2); margin: var(--space-1) 0 0; }
.talk-list .rest-actions { margin-bottom: var(--space-3); }
