:root {
  --bg: #f3f1ec;
  --card: #fff;
  --ink: #16151a;
  --muted: #6d6a73;
  --line: #e2ded6;
  --accent: #d6336c;
  --accent-ink: #fff;
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #121116; --card: #1c1b22; --ink: #f0eef3; --muted: #a29fab; --line: #2c2a33; --accent: #ff5a8f; --accent-ink: #121116; }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.brand .dot { color: var(--accent); }
.tag {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
.logo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .95rem;
}

button {
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: .45em 1.1em;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.compose, .trut, aside {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.compose { padding: 12px 14px; margin-bottom: 14px; }
textarea {
  width: 100%;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}
.compose-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: var(--muted); }
#post-msg { margin: .5em 0 0; color: var(--muted); font-size: .95rem; min-height: 1.2em; }

.trut {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  animation: in .35s ease-out;
}
@keyframes in { from { opacity: 0; transform: translateY(-6px); } }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: var(--bg);
}
.who { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.who b { font-weight: 700; }
.who span { color: var(--muted); font-size: .9rem; }
.text { margin: 2px 0 6px; overflow-wrap: anywhere; }
.text.caps { text-transform: uppercase; font-weight: 600; }
.actions { display: flex; gap: 18px; color: var(--muted); font-size: .9rem; }
.actions button {
  background: none;
  color: var(--muted);
  padding: 0;
  font-weight: 500;
}
.actions button:hover, .actions button.on { color: var(--accent); filter: none; }

aside { padding: 14px 16px; align-self: start; position: sticky; top: 72px; }
aside h2 { margin: 0 0 .4em; font-size: 1.05rem; }
#trending { margin: 0 0 1em; padding-left: 1.3em; }
#trending li { margin: .35em 0; }
#trending small { display: block; color: var(--muted); }
.note { font-size: .85rem; color: var(--muted); margin: 0; }

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  max-width: 340px;
  text-align: center;
}
dialog::backdrop { background: rgb(0 0 0 / .45); }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  aside { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .trut { animation: none; }
}
