/* me — slim, high-contrast, timeline-first. Dark by default, light when the OS asks for it. */

:root {
  color-scheme: dark;
  --bg: #07070a;
  --raised: #101017;
  --hover: rgba(255, 255, 255, 0.04);
  --text: #ededf2;
  --muted: #8b8b99;
  --border: #1c1c24;
  --accent: #ff2a2a;
  --accent-soft: rgba(255, 42, 42, 0.13);
  --glow: rgba(255, 42, 42, 0.45);
  --primary-bg: #ededf2;
  --primary-text: #0b0b0f;
  --like: #ff3d8b;
  --news: #f0b429;
  --danger: #ff4d5e;
  --header: rgba(7, 7, 10, 0.78);
  --col: 600px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --raised: #f4f4f7;
    --hover: rgba(18, 18, 23, 0.035);
    --text: #121217;
    --muted: #6b6b78;
    --border: #ebebf0;
    --accent: #d61f1f;
    --accent-soft: rgba(214, 31, 31, 0.08);
    --glow: rgba(214, 31, 31, 0.28);
    --primary-bg: #121217;
    --primary-text: #ffffff;
    --like: #f0186f;
    --news: #a3761a;
    --danger: #e0243a;
    --header: rgba(255, 255, 255, 0.82);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
}
.icon svg {
  width: 100%;
  height: 100%;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}

/* ---------- header & nav ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: var(--col);
  margin: 0 auto;
  height: 52px;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand .logo {
  display: block;
  width: 30px;
  height: 30px;
}
.wordmark {
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.045em;
  background: linear-gradient(100deg, var(--accent), var(--like));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rail-extra,
.side-rail {
  display: none;
}
nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
nav a:hover {
  background: var(--hover);
  color: var(--text);
}
nav a.active {
  color: var(--text);
}
nav a.active .icon svg {
  stroke-width: 2.4;
}
nav .label {
  display: none;
}
@media (min-width: 900px) {
  nav .label {
    display: inline;
  }
  .top-inner {
    max-width: 960px;
  }
}
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--like);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
nav .count-badge {
  position: absolute;
  top: 3px;
  left: 22px;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- column ---------- */

main {
  max-width: var(--col);
  min-height: calc(100vh - 52px);
  margin: 0 auto;
  padding-bottom: 64px;
}
@media (min-width: 640px) {
  main {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
  padding: 14px 16px 10px;
}
.intro {
  margin: -4px 16px 12px;
  font-size: 14px;
}
.empty,
.note {
  color: var(--muted);
  text-align: center;
  padding: 32px 24px;
  margin: 0;
  font-size: 14px;
}
.note a,
.hint a {
  color: var(--accent);
  font-weight: 600;
}
.error {
  color: var(--danger);
  margin: 6px 0 0;
  font-size: 13px;
}
.back {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.back .icon {
  width: 22px;
  height: 22px;
}

/* ---------- buttons & inputs ---------- */

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  background: var(--primary-bg);
  color: var(--primary-text);
  border: 1px solid var(--primary-bg);
  white-space: nowrap;
}
.btn:hover {
  opacity: 0.88;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.ghost:hover {
  background: var(--hover);
  opacity: 1;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color 0.15s, background-color 0.15s;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}
textarea {
  resize: vertical;
  min-height: 72px;
}

/* ---------- cards (forms, panels) ---------- */

.card {
  margin: 12px 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.form {
  display: grid;
  gap: 12px;
  max-width: 400px;
  margin: 24px auto;
}
@media (max-width: 440px) {
  .form {
    margin: 16px;
  }
}
.form h1 {
  padding: 0 0 4px;
  font-size: 24px;
}
.form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.form .btn {
  height: 40px;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent-soft), transparent);
}
.banner p {
  margin: 0;
  font-weight: 600;
}
.row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---------- tabs ---------- */

.tabs {
  position: sticky;
  top: 52px;
  z-index: 5;
  display: flex;
  background: var(--header);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.tabs button {
  position: relative;
  flex: 1;
  height: 48px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.tabs button:hover {
  background: var(--hover);
}
.tabs button[aria-selected="true"] {
  color: var(--text);
  font-weight: 700;
}
.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 52px;
  height: 4px;
  margin-left: -26px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--like));
}

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

.composer {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.composer textarea {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 8px 0;
  min-height: 52px;
  font-size: 17px;
  resize: none;
}
.composer textarea:focus {
  background: transparent;
}
.composer .preview {
  position: relative;
  margin-top: 4px;
}
.composer .preview img {
  max-height: 260px;
  margin-top: 0;
}
.composer .preview button {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}
.composer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.composer-bar .spacer {
  flex: 1;
}
.attach {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: -8px;
  border-radius: 999px;
  color: var(--accent);
  cursor: pointer;
}
.attach:hover {
  background: var(--accent-soft);
}
.attach:focus-within {
  outline: 2px solid var(--accent);
}
.attach input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.count.over {
  color: var(--danger);
  font-weight: 700;
}

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

.feed {
  display: block;
}
.post {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px 4px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.12s;
}
.post:hover {
  background: var(--hover);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue, 255) 75% 58%), hsl(calc(var(--hue, 255) + 45) 80% 48%));
  text-transform: uppercase;
  flex: none;
}
.avatar.lg {
  width: 84px;
  height: 84px;
  font-size: 32px;
  box-shadow: 0 0 0 4px var(--bg);
}
.post-head {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}
.post-head .name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
.post-head .name:hover {
  text-decoration: underline;
}
.post-head .handle,
.post-head .time {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-head .handle {
  flex-shrink: 2;
}
.post-head .time {
  flex: none;
}
.post-head .time:hover {
  text-decoration: underline;
}
.reply-tag {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.post-body {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.post.focus {
  grid-template-columns: 40px minmax(0, 1fr);
}
.post.focus .post-body {
  font-size: 17px;
  line-height: 1.45;
}
.media {
  display: block;
  max-width: 100%;
  max-height: 510px;
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.link-card {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: background-color 0.12s;
}
.link-card:hover {
  background: var(--hover);
}
.link-host {
  color: var(--muted);
  font-size: 13px;
}
.link-title {
  font-weight: 600;
  line-height: 1.3;
}
.mention,
.hashtag,
.inline-link {
  color: var(--accent);
}
.mention:hover,
.hashtag:hover,
.inline-link:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 36px;
  margin: 4px 0 0 -8px;
}
.action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  height: 34px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.action .icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 999px;
  transition: background-color 0.12s, color 0.12s;
}
.action.reply:hover {
  color: var(--accent);
}
.action.reply:hover .icon {
  background: var(--accent-soft);
}
.action.like:hover,
.action.like.on {
  color: var(--like);
}
.action.like:hover .icon {
  background: color-mix(in srgb, var(--like) 14%, transparent);
}
.action.like.on svg {
  fill: currentColor;
}
.action.delete {
  margin-left: auto;
  min-width: 34px;
}
.action.delete:hover {
  color: var(--danger);
}
.action.delete:hover .icon {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .action.like.on .icon {
    animation: pop 0.28s ease-out;
  }
}
@keyframes pop {
  50% {
    transform: scale(1.25);
  }
}
.more {
  display: flex;
  margin: 16px auto;
}

.badge {
  display: inline-block;
  align-self: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 5px;
  margin-left: 2px;
  line-height: 1.1;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.news {
  background: color-mix(in srgb, var(--news) 15%, transparent);
  color: var(--news);
}

/* ---------- explore ---------- */

.side {
  padding: 14px 16px;
}
.side h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.trending {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: trend;
}
.trending li {
  counter-increment: trend;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
}
.trending li::before {
  content: counter(trend);
  color: var(--muted);
  font-size: 12px;
  width: 14px;
}
.trending a {
  font-weight: 700;
  flex: 1;
}
.trending a:hover {
  color: var(--accent);
}
.trending .muted {
  font-size: 13px;
}
.people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.people li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.person {
  min-width: 0;
  line-height: 1.25;
}
.person .name {
  font-weight: 700;
}
.person .muted {
  font-size: 14px;
}
.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--border);
}

/* ---------- notifications & messages ---------- */

.row-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.row-item:hover {
  background: var(--hover);
}
.row-item.unread {
  background: var(--accent-soft);
}
.row-item b {
  font-weight: 700;
}
.snippet {
  margin: 2px 0 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.new-dm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
}
.new-dm .muted {
  font-size: 14px;
  white-space: nowrap;
}
.new-dm input {
  flex: 1;
  min-width: 80px;
}
.conv-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.25;
}
.conv-head + .muted {
  margin: 10px 16px 0;
}
.bubbles {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
}
.bubble {
  max-width: 78%;
  justify-self: start;
  padding: 8px 13px;
  border-radius: 20px 20px 20px 6px;
  background: var(--raised);
}
.bubble .muted {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}
.bubble.mine {
  justify-self: end;
  border-radius: 20px 20px 6px 20px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--like)));
  color: #fff;
}
.bubble.mine .muted,
.bubble.mine a {
  color: rgba(255, 255, 255, 0.85);
}
.bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dm-composer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.dm-composer textarea {
  min-height: 40px;
  height: 40px;
  resize: none;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: 20px;
  padding: 9px 14px;
}
.dm-composer .error {
  position: absolute;
  bottom: 100%;
  left: 16px;
}
.dm-composer .row {
  flex: none;
}

/* ---------- profile ---------- */

.profile {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.cover {
  height: 130px;
  background: radial-gradient(120% 140% at 0% 0%, hsl(var(--hue) 80% 60% / 0.9), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, hsl(calc(var(--hue) + 60) 85% 55% / 0.85), transparent 60%),
    hsl(calc(var(--hue) + 30) 50% 20%);
}
.profile-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: -42px;
  padding: 0 16px;
}
.profile-top .row {
  flex-wrap: wrap;
  padding-bottom: 2px;
}
.name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px 0;
}
.name-row h1 {
  padding: 0;
  font-size: 21px;
}
.profile .handle {
  color: var(--muted);
  padding: 0 16px;
}
.profile .bio {
  margin: 10px 16px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.profile > .muted {
  margin: 8px 16px 0;
}
.stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.stats b {
  color: var(--text);
}
.profile form {
  margin: 14px 16px 0;
  max-width: none;
}

/* ---------- phones: bottom tab bar ---------- */

@media (max-width: 639px) {
  /* backdrop-filter on an ancestor would pin the fixed nav to the header instead of the viewport. */
  .top {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg);
  }
  nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    justify-content: space-around;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--header);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
  }
  nav a {
    height: 44px;
    padding: 0 14px;
  }
  nav a .icon {
    width: 24px;
    height: 24px;
  }
  nav .count-badge {
    top: 5px;
    left: 28px;
  }
  main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .dm-composer {
    bottom: calc(53px + env(safe-area-inset-bottom));
  }
  .actions {
    gap: 20px;
  }
}

/* ---------- compose dialog & toast (desktop "Post" button) ---------- */

.compose-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  margin: 7vh auto auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 24px 80px -20px rgba(0, 0, 0, 0.6);
}
.compose-dialog::backdrop {
  background: rgba(8, 8, 16, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  padding: 8px 10px 0;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
}
.icon-btn:hover {
  background: var(--hover);
}
.compose-dialog .composer {
  border-bottom: 0;
  padding: 4px 16px 14px;
}
.compose-dialog .composer textarea {
  min-height: 110px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
}
.toast a {
  font-weight: 800;
  text-decoration: underline;
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 0.2s ease-out;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* ---------- desktop: left rail · timeline · right rail ---------- */

@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: 72px minmax(0, var(--col)) 328px;
    justify-content: center;
    align-items: start;
  }

  /* Left rail */
  .top {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
  }
  .top-inner {
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 6px 10px 14px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
  }
  .brand {
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-bottom: 4px;
    border-radius: 999px;
  }
  .brand:hover {
    background: var(--hover);
  }
  .brand .logo {
    display: block;
  }
  .brand .wordmark {
    display: none;
  }
  nav {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  nav .label {
    display: none;
  }
  nav a {
    height: 50px;
    padding: 0 12px;
    gap: 16px;
    color: var(--text);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  nav a .icon {
    width: 26px;
    height: 26px;
  }
  nav a.active {
    font-weight: 800;
  }
  nav .count-badge {
    top: 6px;
    left: 26px;
  }
  .rail-extra {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .post-btn {
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-top: 14px;
    border-radius: 999px;
    background: linear-gradient(100deg, var(--accent), var(--like));
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
    transition: filter 0.12s, transform 0.12s;
  }
  .post-btn:hover {
    filter: brightness(1.08);
  }
  .post-btn:active {
    transform: scale(0.97);
  }
  .post-btn .label {
    display: none;
  }
  .account {
    position: relative;
    margin-top: auto;
    max-width: 100%;
  }
  .account > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 999px;
    list-style: none;
    cursor: pointer;
  }
  .account > summary::-webkit-details-marker {
    display: none;
  }
  .account > summary:hover,
  .account[open] > summary {
    background: var(--hover);
  }
  .account .who,
  .account > summary > .icon {
    display: none;
  }
  .who {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
  }
  .who b,
  .who span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .who span {
    color: var(--muted);
    font-size: 14px;
  }
  .menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    min-width: 240px;
    padding: 6px 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 36px -12px rgba(0, 0, 0, 0.45);
  }
  .menu a,
  .menu button {
    display: block;
    width: 100%;
    padding: 11px 16px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
  }
  .menu a:hover,
  .menu button:hover {
    background: var(--hover);
  }

  /* Timeline */
  main {
    min-height: 100vh;
  }
  .tabs {
    top: 0;
  }
  section > h1:first-child,
  section > .back:first-child {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--header);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
  .home {
    display: flex;
    flex-direction: column;
  }
  .home > .tabs {
    order: -1;
  }
  .home > .banner {
    order: -2;
  }

  /* Right rail */
  .side-rail {
    position: sticky;
    top: 0;
    display: grid;
    align-content: start;
    gap: 16px;
    max-height: 100vh;
    overflow-y: auto;
    padding: 12px 0 24px 24px;
    scrollbar-width: none;
  }
  .side-rail::-webkit-scrollbar {
    display: none;
  }
  .panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
  }
  .panel h2 {
    margin: 0;
    padding: 12px 16px 6px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.025em;
  }
  .panel-item {
    display: block;
    padding: 9px 16px;
    transition: background-color 0.12s;
  }
  .panel-item:hover,
  .panel-more:hover,
  .panel .people li:hover {
    background: var(--hover);
  }
  .panel-item > span {
    display: block;
  }
  .meta {
    color: var(--muted);
    font-size: 12.5px;
  }
  .trend-tag {
    font-weight: 700;
  }
  .headline {
    margin-top: 1px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.32;
    overflow: hidden;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .panel .people li {
    padding: 9px 16px;
    transition: background-color 0.12s;
  }
  .panel .person {
    font-size: 14.5px;
  }
  .person-line {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }
  .person-line .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .person-line .name:hover {
    text-decoration: underline;
  }
  .panel .person .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .panel .btn {
    height: 32px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  .panel-more {
    display: block;
    padding: 12px 16px;
    color: var(--accent);
    font-size: 14px;
  }
  .join {
    padding-bottom: 16px;
    background: linear-gradient(150deg, var(--accent-soft), transparent 70%);
  }
  .join p {
    margin: 2px 16px 12px;
    color: var(--muted);
    font-size: 14px;
  }
  .join .btn {
    display: flex;
    margin: 8px 16px 0;
    height: 38px;
  }
  .side-foot {
    margin: 0;
    padding: 0 16px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
  }
}

/* Wide screens: labelled rail */
@media (min-width: 1280px) {
  .shell {
    grid-template-columns: 250px var(--col) 374px;
  }
  .top-inner {
    align-items: flex-start;
    padding: 6px 24px 14px 4px;
  }
  .brand {
    width: auto;
    padding: 0 12px;
  }
  .brand .wordmark {
    display: inline;
    font-size: 22px;
  }
  nav {
    align-items: flex-start;
  }
  nav .label {
    display: inline;
  }
  nav a {
    padding: 0 20px 0 12px;
  }
  .rail-extra {
    align-items: stretch;
  }
  .post-btn {
    width: 100%;
    height: 50px;
  }
  .post-btn .icon {
    display: none;
  }
  .post-btn .label {
    display: inline;
  }
  .account {
    max-width: none;
  }
  .account > summary {
    padding: 10px 12px;
  }
  .account .who {
    display: block;
  }
  .account > summary > .icon {
    display: inline-grid;
  }
}


/* ==========================================================================
   Identity pass
   The palette above was the purple-to-pink default that almost every social
   template ships with, which made this look like all of them. The logo is a
   neon-red sign and the sibling game runs on the same red, so the accent now
   comes from the brand instead of from the template.
   ========================================================================== */

/* Self-hosted rather than loaded from Google: public/_headers sets
   default-src 'self' with no font-src or style-src exception, so an external
   stylesheet is blocked outright — the font would silently never arrive and
   everything would fall back to the system stack. Two latin subsets, ~15KB
   each, and the strict CSP stays as it is. Rajdhani is OFL licensed. */
@font-face {
  font-family: Rajdhani;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/rajdhani-600.woff2") format("woff2");
}
@font-face {
  font-family: Rajdhani;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/rajdhani-700.woff2") format("woff2");
}

/* Display face for the marks and labels only. Post bodies stay on the system
   stack, which is more readable at 15px and does not cost a webfont wait. */
.wordmark,
.badge,
.side h2,
.tabs button {
  font-family: Rajdhani, ui-sans-serif, system-ui, sans-serif;
}

/* The mark carries its own light and fades out at its edges, so it needs
   neither the red drop-shadow nor the corner rounding that the old photo tile
   did — there is no square edge left to round. */

.wordmark {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: var(--accent);
  text-shadow: 0 0 14px var(--glow);
}

/* Avatars were rainbow hsl() gradients — the stock placeholder look, and six
   competing hues per screen. Outlined instead, echoing the logo, which is
   itself an outline of a head. */
.avatar {
  background: var(--raised);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 42, 42, 0.1);
  font-weight: 700;
}
.post:hover .avatar {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

/* The rail was a stack of outlined 16px pills — the single most template-like
   thing left on the page. Dropping the outline for a slightly lifted surface
   lets the panels sit in the page instead of on top of it. */
.card {
  border: none;
  border-radius: 12px;
  background: var(--raised);
}

/* The feed divider is doing the separating now, so give it a little more
   presence than the panel edges it used to compete with. */
.post {
  border-bottom-color: color-mix(in srgb, var(--border) 85%, var(--accent));
}

.side h2 {
  letter-spacing: 0.02em;
}

.badge {
  border-radius: 3px;
  letter-spacing: 0.08em;
}

/* The right rail is only a rail above 1024px, where .panel gives each block a
   1px outline and a 16px radius — a stack of pills beside a stack of pills,
   which was the most template-like thing left on the page. Same lifted surface
   as .card instead, so the panels sit in the page rather than on top of it. */
@media (min-width: 1024px) {
  .panel {
    border: none;
    border-radius: 12px;
    background: var(--raised);
  }
}
