/* Стиль архива: mobile-first, одна колонка, без внешних шрифтов и CDN
   (constraint 13 — всё своё, из web/static). */

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --fg-muted: #6b6b6b;
  --border: #dcdcdc;
  --accent: #2557a7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e8e8e8;
    --fg-muted: #a0a0a0;
    --border: #333333;
    --accent: #7aa7e0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.topbar__title {
  font-weight: 600;
}

.topbar__logout button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--fg);
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

.content {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem;
}

a {
  color: var(--accent);
}

.tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-list__item + .tree-list__item {
  border-top: 1px solid var(--border);
}

.tree-list__link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.25rem;
  text-decoration: none;
  color: inherit;
}

.tree-list__title {
  font-weight: 600;
  color: var(--fg);
}

.tree-list__meta {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.tree-list__preview {
  font-size: 0.9rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-header {
  margin-bottom: 1rem;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feed__older {
  text-align: center;
}

.msg {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  max-width: 34rem;
}

.msg--out {
  margin-left: auto;
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.msg--out a {
  color: #ffffff;
}

.msg__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.msg--out .msg__meta {
  color: rgba(255, 255, 255, 0.8);
}

.msg__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 0.25rem;
}

.msg__reply {
  font-size: 0.85rem;
  border-left: 2px solid var(--border);
  padding-left: 0.5rem;
  margin-top: 0.25rem;
  color: var(--fg-muted);
}

.msg__reply--unresolved {
  font-style: italic;
}

.msg__badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.badge {
  font-size: 0.75rem;
  border-radius: 0.25rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border);
}

.badge--deleted {
  color: #b3261e;
  border-color: #b3261e;
}

.badge--edited {
  color: var(--fg-muted);
}

.msg__revisions {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.msg__attachments {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  padding-left: 1.1rem;
}

.attachment {
  margin-top: 0.25rem;
}

.attachment__image,
.attachment__video {
  max-width: 100%;
  border-radius: 0.35rem;
  display: block;
}

.attachment audio {
  width: 100%;
}

.attachment__link {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
}

.attachment__meta {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.msg--out .attachment__meta {
  color: rgba(255, 255, 255, 0.8);
}

.attachment__status {
  color: var(--fg-muted);
  font-style: italic;
}

.msg--out .attachment__status {
  color: rgba(255, 255, 255, 0.8);
}

.attachment__card {
  border: 1px dashed var(--border);
  border-radius: 0.35rem;
  padding: 0.35rem 0.5rem;
}

.attachment__kind {
  font-weight: 600;
}

.attachment__meta-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--fg-muted);
}

.msg--out .attachment__meta-list {
  color: rgba(255, 255, 255, 0.8);
}

.attachment__meta-key {
  font-weight: 500;
}
