/* Task conversation: event lines, posts (update posts as highlighted cards), Markdown, composer. */

.conversation {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.timeline {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline__empty {
  color: var(--ink-2);
  font-size: 14px;
}

.tabs__filter {
  margin-left: auto;
  align-self: center;
}

.segmented--small {
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
}

.segmented--small button {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-small);
  font-size: 12px;
}

/* ---------------------------------------------------------------- events */

.event-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
}

.event-line strong {
  color: var(--ink);
  font-weight: 600;
}

.event-line time {
  margin-left: auto;
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- posts */

.post {
  display: flex;
  gap: 12px;
}

.post > .avatar {
  --size: 32px;
}

.post__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0;
}

.post--update .post__main {
  gap: 8px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  border-radius: var(--radius-panel);
}

.post__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post__author {
  font-size: 14px;
  font-weight: 600;
}

.update-badge {
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-chip);
  background: var(--accent-button, var(--accent));
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.post__time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

.post__actions {
  display: flex;
  gap: 4px;
}

.post__actions .link-button {
  font-size: 12px;
  padding: 2px;
}

/* Rendered Markdown (sanitized on the server). */
.md {
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.md > * + * {
  margin-top: 6px;
}

.md p,
.md ul,
.md ol,
.md pre,
.md blockquote,
.md table {
  margin-bottom: 0;
}

.md ul,
.md ol {
  padding-left: 20px;
  margin-top: 0;
}

.md h1,
.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
  font-size: 15px;
  margin: 8px 0 0;
}

.md code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-muted);
  padding: 1px 5px;
  border-radius: var(--radius-chip);
}

.md pre {
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-small);
  overflow-x: auto;
}

.md pre code {
  padding: 0;
  background: none;
}

.md blockquote {
  margin-left: 0;
  padding-left: 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--ink-2);
}

.md img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  cursor: zoom-in;
}

.md table {
  border-collapse: collapse;
}

.md th,
.md td {
  border: 1px solid var(--border);
  padding: 4px 8px;
}

.md .mention {
  color: var(--started-ink);
  background: var(--started-bg);
  font-weight: 600;
  padding: 0 4px;
  border-radius: var(--radius-chip);
}

.md .task-ref {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- composer */

.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 28px 18px;
  border-top: 1px solid var(--divider);
  background: var(--surface-sunken);
}

.composer--inline {
  padding: 0;
  border: 0;
  background: none;
}

.composer__box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
}

.composer__box--dragover {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.composer__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}

.composer__modes {
  display: flex;
  gap: 2px;
  margin-right: 8px;
}

.composer__modes button,
.composer__tool {
  height: 32px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--ink-chip);
}

.composer__modes button {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.composer__modes button[aria-pressed="true"] {
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 600;
}

.composer__tool {
  width: 32px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.composer__tool:hover,
.composer__modes button:hover {
  background: var(--hover);
}

.composer__tool:disabled {
  opacity: 0.4;
}

.composer textarea {
  border: 0;
  outline: none;
  resize: vertical;
  min-height: 72px;
  padding: 10px 12px;
  font: 13px/1.5 var(--font-mono);
  color: var(--ink);
  background: transparent;
}

.composer__preview {
  min-height: 72px;
  padding: 10px 12px;
}

.composer__files {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 12px 10px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 4px 0 10px;
  border-radius: var(--radius-small);
  background: var(--surface-muted);
  font-size: 12px;
  color: var(--ink-chip);
}

.file-chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
}

.composer__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.composer__foot label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  font-size: 13px;
  color: var(--ink-chip);
}

.composer__foot input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.composer__hint {
  font-size: 12px;
  color: var(--ink-2);
}

.composer__foot .btn--primary {
  margin-left: auto;
}

@media (max-width: 480px) {
  .timeline,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer__hint {
    display: none;
  }
}
