:root {
  color-scheme: light;
  --bg: #f4f5f8;
  --bg-secondary: #eef2f7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-muted: #f2f5fa;
  --text: #101522;
  --text-soft: #61697b;
  --line: rgba(17, 24, 39, 0.12);
  --accent: #1775ff;
  --accent-strong: #0e61db;
  --accent-soft: rgba(23, 117, 255, 0.12);
  --green: #8dcc18;
  --emoji-filter: drop-shadow(0 0 1px rgba(16, 21, 34, 0.5));
  --shadow: 0 14px 38px rgba(20, 35, 61, 0.07);
  --shadow-soft: 0 8px 20px rgba(20, 35, 61, 0.05);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1106px;
  --font-sans: "IBM Plex Sans", "Manrope", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f15;
  --bg-secondary: #111722;
  --surface: rgba(17, 23, 34, 0.94);
  --surface-strong: #131a26;
  --surface-muted: rgba(25, 33, 47, 0.96);
  --text: #f3f6fb;
  --text-soft: #9ba8bb;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #66a5ff;
  --accent-strong: #8ab8ff;
  --accent-soft: rgba(102, 165, 255, 0.18);
  --green: #9ae521;
  --emoji-filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.42));
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.2);
}

:root[data-theme="system"] {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0b0f15;
    --bg-secondary: #111722;
    --surface: rgba(17, 23, 34, 0.94);
    --surface-strong: #131a26;
    --surface-muted: rgba(25, 33, 47, 0.96);
    --text: #f3f6fb;
    --text-soft: #9ba8bb;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #66a5ff;
    --accent-strong: #8ab8ff;
    --accent-soft: rgba(102, 165, 255, 0.18);
    --green: #9ae521;
    --emoji-filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.42));
    --shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
    --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 12.6px;
  font-family: var(--font-sans);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(23, 117, 255, 0.1), transparent 32%),
    radial-gradient(circle at top right, rgba(141, 204, 24, 0.06), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.1;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 90%);
}

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

button,
input {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(calc(100% - 20px), var(--container));
  margin: 12px auto 0;
  padding-bottom: 32px;
  min-width: 0;
}

.hero {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero__identity,
.hero__controls,
.hero__actions {
  display: flex;
  align-items: center;
}

.hero__identity {
  gap: 14px;
  min-width: 0;
}

.hero__avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.hero__copy {
  min-width: 0;
}

.hero__eyebrow {
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.34rem, 3vw, 1.78rem);
  line-height: 1;
}

.hero__meta {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.hero__controls {
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

.search {
  flex: 1;
  max-width: 440px;
}

.search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.search__input {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  outline: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.search__input::placeholder {
  color: #7a8397;
  opacity: 1;
}

.search__input:hover {
  background: #edf2f9;
}

.search__input:focus {
  border-color: var(--accent);
  background: #f8fbff;
  box-shadow: 0 0 0 4px rgba(23, 117, 255, 0.1);
  transform: translateY(-1px);
}

.hero__actions {
  gap: 8px;
}

.theme-toggle,
.hero__origin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.theme-toggle {
  width: 40px;
  padding: 0;
  cursor: pointer;
}

.theme-toggle__icon {
  font-size: 16px;
  line-height: 1;
}

.hero__origin {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 600;
  min-width: 166px;
  white-space: nowrap;
}

.main-shell {
  margin-top: 14px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.feed-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.results-bar,
.sidebar-card,
.post-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

.results-bar--summary {
  align-items: stretch;
}

.results-bar__intro {
  min-width: 0;
}

.results-bar__headline {
  font-size: 0.94rem;
  font-weight: 700;
}

.results-bar__subline,
.results-bar__meta {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.results-bar__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.results-bar__metrics {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.results-metric {
  min-width: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.results-metric__label {
  display: block;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.results-metric__value {
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

.post-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 15px;
}

.post-card__header,
.post-card__footer,
.post-card__header-main,
.post-card__author,
.post-card__stats,
.post-card__reactions {
  display: flex;
  align-items: center;
}

.post-card__header,
.post-card__footer {
  justify-content: space-between;
  gap: 14px;
}

.post-card__header {
  margin-bottom: 10px;
}

.post-card__header-main {
  gap: 10px;
  min-width: 0;
}

.post-card__author {
  gap: 10px;
  min-width: 0;
}

.post-card__author--detail {
  gap: 0;
  padding-right: 0;
}

.post-card__author--detail .post-card__channel {
  color: var(--text-soft);
}

.post-card__back-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.post-card__back-link:hover {
  color: var(--accent);
}

.post-card__header-side {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-left: auto;
}

.post-card__author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.post-card__channel {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.post-card__date {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.post-card__edited {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
}

.post-card__title {
  margin: 0 0 11px;
  font-size: clamp(1.06rem, 2vw, 1.28rem);
  line-height: 1.28;
}

.post-card__title a {
  transition: color 160ms ease;
}

.post-card__title a:hover {
  color: var(--accent);
}

.post-card__title--detail {
  font-size: clamp(1.24rem, 2.4vw, 1.62rem);
}

.post-card__content {
  overflow: hidden;
  transition: height 170ms cubic-bezier(0.2, 0, 0, 1);
}

.post-card__content.is-collapsed {
  position: relative;
  max-height: 14.2em;
  overflow: hidden;
}

.post-card__content.is-collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2.8em;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--surface) 88%);
}

.post-card__content.is-expanded {
  max-height: none;
}

.post-card__content.is-expanded::after {
  display: none;
}

.expand-button {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.post-tags--header {
  margin-top: 0;
  justify-content: flex-end;
  max-width: 220px;
}

.post-tags--header .post-tag {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.8rem;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.rich-text {
  color: var(--text);
  line-height: 1.7;
  font-size: 0.98rem;
}

.rich-text p {
  margin: 0 0 1rem;
}

.rich-text p:last-child {
  margin-bottom: 0;
}

.rich-text a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 46%, transparent);
}

.rich-text blockquote {
  position: relative;
  margin: 0.74rem 0 0.95rem;
  padding: 12px 38px 12px 14px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 76%, white);
  border-radius: 0 13px 13px 0;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-muted));
  font-size: 0.96rem;
  line-height: 1.6;
}

.rich-text blockquote::after {
  content: "”";
  position: absolute;
  top: 8px;
  right: 12px;
  color: color-mix(in srgb, var(--accent) 46%, transparent);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.rich-text p + blockquote {
  margin-top: -0.16rem;
}

.rich-text blockquote p {
  margin-bottom: 0.72rem;
}

.rich-text blockquote p:last-child {
  margin-bottom: 0;
}

.rich-text blockquote.quote-collapsible {
  cursor: pointer;
}

.quote-collapsible__body {
  position: relative;
  max-height: 60rem;
  overflow: hidden;
  transition: max-height 180ms cubic-bezier(0.2, 0, 0, 1);
}

.quote-collapsible:not(.is-expanded) .quote-collapsible__body {
  max-height: 6.4em;
}

.quote-collapsible:not(.is-expanded) .quote-collapsible__body::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2.8em;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--accent) 7%, var(--surface-muted)) 86%
  );
}

.quote-collapsible__toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.quote-collapsible__toggle:hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.quote-collapsible--short {
  cursor: default;
}

.quote-collapsible--short .quote-collapsible__body::after {
  display: none;
}

.quote-collapsible__chevron {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 160ms ease;
}

.quote-collapsible.is-expanded .quote-collapsible__chevron {
  transform: translateY(1px) rotate(180deg);
}

.rich-text .spoiler {
  position: relative;
  display: inline;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  vertical-align: baseline;
}

.rich-text .spoiler:not(.is-revealed)::before {
  content: none;
}

.rich-text .spoiler__inner {
  position: relative;
  padding: 0 0.08em;
  border-radius: 4px;
  background:
    radial-gradient(circle at 18% 28%, color-mix(in srgb, var(--text) 48%, transparent) 0 1px, transparent 1.35px),
    radial-gradient(circle at 70% 62%, color-mix(in srgb, var(--text) 34%, transparent) 0 1px, transparent 1.45px);
  background-size: 6px 6px, 8px 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  color: transparent;
  text-shadow: none;
  transition: background 150ms ease, color 150ms ease;
  user-select: none;
  animation: spoilerShimmer 2.6s linear infinite;
}

.rich-text .spoiler.is-revealed {
  background: transparent;
}

.rich-text .spoiler.is-revealed .spoiler__inner {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: inherit;
  text-shadow: none;
  user-select: text;
  animation: spoilerReveal 180ms ease-out;
}

@keyframes spoilerShimmer {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 18px 0, -16px 0;
  }
}

@keyframes spoilerReveal {
  from {
    opacity: 0.72;
    transform: translateY(0.03em);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-media {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-muted) 86%, transparent), color-mix(in srgb, var(--surface-strong) 70%, transparent));
}

.post-media__lightbox-trigger,
.post-media__frame {
  display: block;
  width: 100%;
  max-width: min(100%, var(--media-max-width, 100%));
  min-width: 0;
}

.post-media__lightbox-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.post-card--detail .post-media__lightbox-trigger,
.post-card--detail .post-media__frame--video {
  max-height: min(82vh, 1100px);
}

.post-media img,
.post-media video {
  display: block;
  width: 100%;
  max-width: 100%;
}

.post-card:not(.post-card--detail) .post-media {
  aspect-ratio: 16 / 9;
  max-height: 420px;
}

.post-card:not(.post-card--detail) .post-media__lightbox-trigger,
.post-card:not(.post-card--detail) .post-media__frame {
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.post-card:not(.post-card--detail) .post-media img,
.post-card:not(.post-card--detail) .post-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.post-card:not(.post-card--detail) .post-media--image:not(.post-media--tall) img {
  margin: 0 auto;
}

.post-card:not(.post-card--detail) .post-media--tall {
  width: min(100%, 432px);
  aspect-ratio: 4 / 5;
  max-height: 540px;
  margin-left: auto;
  margin-right: auto;
}

.post-card:not(.post-card--detail) .post-media--tall .post-media__lightbox-trigger {
  overflow: hidden;
}

.post-card:not(.post-card--detail) .post-media--tall img {
  object-fit: contain;
  object-position: center;
}

.post-card--detail .post-media img {
  max-width: 100%;
  max-height: min(82vh, 1100px);
  margin: 0 auto;
  object-fit: contain;
}

.post-media__frame--video {
  aspect-ratio: 16 / 9;
  background: #000;
}

.post-media__video {
  height: 100%;
  object-fit: contain;
}

.link-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.link-preview__media {
  overflow: hidden;
  border-radius: 14px;
}

.link-preview__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-preview__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-preview__site {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.link-preview__title {
  font-weight: 700;
}

.link-preview__description {
  color: var(--text-soft);
  line-height: 1.5;
}

.post-card__footer {
  margin-top: 14px;
  align-items: center;
  flex-wrap: nowrap;
}

.post-card__reactions {
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
  overflow: visible;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.4;
}

.reaction-pill__emoji {
  font-size: 1.06rem;
}

.reaction-pill--more {
  color: var(--text-soft);
  font-weight: 700;
  cursor: pointer;
}

.reaction-pill--more:hover,
.reaction-pill--more[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.reactions-more {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.reactions-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  min-width: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.reactions-popover__list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.post-card__stats {
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.86rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.post-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
}

.post-card__stat--time {
  text-align: right;
}

.post-card__stat-icon {
  width: 16px;
  height: 16px;
  color: #8d95a8;
}

.post-card__stat-icon svg {
  width: 100%;
  height: 100%;
}

.post-menu-wrap {
  position: relative;
}

.post-menu-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.post-menu-button:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}

.post-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 198px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.post-menu[hidden] {
  display: none;
}

.post-menu button,
.post-menu a {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.post-menu button:hover,
.post-menu a:hover {
  background: var(--accent-soft);
}

.post-menu__danger {
  color: #d94a3a;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.sidebar-card {
  padding: 16px;
}

.channel-card {
  text-align: center;
}

.channel-card__avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.channel-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
}

.channel-card__title {
  font-size: 1.22rem;
  font-weight: 800;
}

.channel-card__title--stacked {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.channel-card__title-main,
.channel-card__title-sub {
  display: block;
  font-size: 1.22rem;
  font-weight: 800;
}

.channel-card__title-sub {
  letter-spacing: 0.01em;
}

.channel-card__handle,
.channel-card__description,
.channel-card__subscribers {
  display: block;
}

.channel-card__handle {
  margin-top: 7px;
  color: var(--accent);
  font-weight: 700;
}

.channel-card__subscribers {
  margin-top: 6px;
  color: var(--text-soft);
}

.channel-card__description {
  margin: 8px auto 0;
  max-width: 212px;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.86rem;
}

.channel-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  min-height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.channel-card__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  margin: 10px auto 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
  transition: color 160ms ease;
}

.channel-card__contact:hover {
  color: var(--accent);
}

.channel-card__contact-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.channel-card__contact-icon svg {
  width: 100%;
  height: 100%;
}

.popular-card {
  padding: 15px;
}

.popular-card__title {
  margin-bottom: 3px;
  font-size: 1rem;
  font-weight: 800;
}

.popular-card__subtitle {
  margin-bottom: 13px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.popular-card__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popular-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  margin: 0 -7px;
  border-radius: 14px;
  transition: background 160ms ease, transform 160ms ease;
}

.popular-item:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  transform: translateY(-1px);
}

.popular-item__thumb {
  height: 54px;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(141, 204, 24, 0.16));
}

.popular-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-item__thumb--empty::after {
  content: "TG";
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
}

.popular-item__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  justify-content: center;
}

.popular-item__title {
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.34;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.popular-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.popular-item__views,
.popular-item__reactions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.popular-item__views-icon,
.popular-item__reactions-icon {
  width: 13px;
  height: 13px;
  color: #8d95a8;
}

.popular-item__views-icon svg,
.popular-item__reactions-icon svg {
  width: 100%;
  height: 100%;
}

.rich-text .inline-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.16em;
}

.rich-text .inline-emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--emoji-filter);
}

.empty-state,
.not-found {
  padding: 30px 18px;
  text-align: center;
}

.empty-state h2,
.not-found h1 {
  margin: 0 0 10px;
  font-size: 1.46rem;
}

.empty-state p,
.not-found p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.not-found {
  width: min(calc(100% - 32px), 720px);
  margin: 120px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.not-found__eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.not-found a {
  display: inline-flex;
  margin-top: 18px;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
}

.load-more__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 176px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
}

.load-more__button:hover {
  background: var(--accent-soft);
}

.load-more__meta,
.load-more--end {
  color: var(--text-soft);
  font-size: 0.84rem;
}

body.is-lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 12, 18, 0.88);
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
}

.lightbox__content {
  max-width: min(96vw, 1400px);
  max-height: 90vh;
}

.lightbox__content img,
.lightbox__content video {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  border-radius: 18px;
  background: #000;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.scroll-top {
  position: fixed;
  right: max(18px, calc((100vw - var(--container)) / 2 + 18px));
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  opacity: 0.92;
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease;
}

.scroll-top:hover {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-2px);
}

.scroll-top[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1100px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .channel-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
    text-align: left;
  }

  .channel-card__avatar-wrap {
    grid-row: span 5;
    margin-bottom: 0;
  }

  .channel-card__description {
    margin-left: 0;
    margin-right: 0;
  }

  .channel-card__button {
    width: auto;
    min-width: 168px;
    justify-self: start;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(calc(100% - 18px), var(--container));
    margin-top: 8px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .hero__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero__origin {
    flex: 0 0 auto;
  }

  .results-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-card__header-side {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .post-tags--header {
    justify-content: flex-start;
    margin-right: auto;
    max-width: none;
  }

  .results-bar__metrics {
    width: 100%;
    justify-content: flex-start;
  }

  .post-card {
    padding: 14px;
  }

  .post-media__lightbox-trigger,
  .post-media__frame {
    width: 100%;
    max-width: 100%;
  }

  .link-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero__identity {
    align-items: flex-start;
  }

  .hero__avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .hero__actions {
    gap: 10px;
    flex-wrap: nowrap;
  }

  .theme-toggle,
  .hero__origin {
    min-height: 40px;
  }

  .hero__origin {
    min-width: 166px;
  }

  .post-card__header,
  .post-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-card__author {
    padding-right: 42px;
  }

  .post-card__author--detail {
    padding-right: 0;
  }

  .post-card__footer {
    flex-wrap: wrap;
  }

  .post-card__stats {
    width: 100%;
    justify-content: space-between;
  }

  .post-card__stat--time {
    text-align: left;
  }

  .post-menu-wrap {
    align-self: flex-end;
  }

  .post-card__header-side {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    align-items: center;
  }

  .post-card__header-main {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 42px;
  }

  .post-card__header-main .post-card__author {
    padding-right: 0;
  }

  .popular-item {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .channel-card {
    display: block;
    text-align: center;
  }

  .channel-card__avatar-wrap {
    justify-content: center;
    margin-bottom: 12px;
  }

  .channel-card__description {
    margin-left: auto;
    margin-right: auto;
  }

  .channel-card__button {
    width: 100%;
  }

  .lightbox__dialog {
    padding: 16px;
  }

  .lightbox__close {
    top: 16px;
    right: 16px;
  }
}
