:root {
  --bg: #0f1419;
  --panel: #161b22;
  --panel-strong: #1d242d;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #e7ebef;
  --muted: #8d99a5;
  --accent: #1d9bf0;
  --accent-soft: rgba(29, 155, 240, 0.14);
  --accent-warm: #f5b14c;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(29, 155, 240, 0.1), transparent 24%),
    radial-gradient(circle at bottom right, rgba(245, 177, 76, 0.08), transparent 22%),
    var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  overflow-x: clip;
}

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

.app-shell {
  width: min(1580px, calc(100% - 18px));
  margin: 0 auto;
  padding: 18px 0 32px;
  display: grid;
  grid-template-columns: clamp(248px, 23vw, 316px) minmax(0, 1fr);
  gap: 20px;
}

.left-rail,
.timeline-column {
  min-width: 0;
}

.brand {
  min-width: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.18rem, 1.85vw, 1.64rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  white-space: nowrap;
  line-height: 1;
}

.brand-shell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 25%, rgba(89, 183, 255, 0.22), transparent 38%),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-terminal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  width: 100%;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.18);
}

.brand-prompt {
  color: #73c3ff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.96rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.brand-caret {
  width: 9px;
  height: 1.25em;
  border-radius: 999px;
  background: rgba(115, 195, 255, 0.92);
  box-shadow: 0 0 18px rgba(115, 195, 255, 0.45);
  animation: blink-caret 1s steps(1, end) infinite;
  flex: 0 0 auto;
}

.brand-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: "Instrument Serif", "Source Serif 4", serif;
  font-size: 1.36rem;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.lang-button.is-active {
  background: rgba(29, 155, 240, 0.18);
  color: #dff1ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.14);
}

.rail-card,
.timeline-header,
.post-card,
.reader-card,
.comments-card,
.reader-drawer {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.rail-card,
.reader-card,
.comments-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  min-width: 0;
}

.left-rail {
  display: grid;
  align-content: start;
  gap: 12px;
  position: sticky;
  top: 18px;
  height: fit-content;
}

.rail-label,
.eyebrow,
.meta-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stats {
  display: grid;
  gap: 12px;
  margin: 0;
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.stats dt {
  color: var(--muted);
}

.stats dd {
  margin: 0;
  font-weight: 700;
}

.search-block {
  display: grid;
}

.social-links,
.friend-links {
  display: grid;
  gap: 10px;
}

.friends-toggle {
  display: none;
  margin-top: 10px;
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.labels-toggle {
  display: none;
  margin-top: 10px;
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.social-link,
.friend-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.social-link:hover,
.social-link:focus-visible,
.friend-link:hover,
.friend-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 155, 240, 0.24);
  background: rgba(29, 155, 240, 0.06);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.icon-badge {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(255, 255, 255, 0.02);
  color: #a8d9ff;
}

.ui-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-name,
.friend-link strong {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.social-handle,
.friend-link span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.search-block input,
.page-size select {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0f1419;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
}

.label-filters,
.post-tags,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.label-chip,
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--pill-border, var(--line));
  border-radius: 999px;
  background: var(--pill-bg, var(--panel-strong));
  color: var(--pill-fg, var(--muted));
  font-size: 0.88rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.label-chip {
  cursor: pointer;
}

.label-chip.is-active {
  border-color: rgba(29, 155, 240, 0.4);
  background: var(--accent-soft);
  color: #d8efff;
}

.timeline-column {
  display: grid;
  gap: 14px;
  transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
}

body.modal-open .left-rail,
body.modal-open .timeline-column {
  filter: blur(2px);
  opacity: 0.55;
  transform: scale(0.985);
}

.timeline-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  overflow: visible;
}

.timeline-header h1,
.reader-shell h2,
.comments-card h3 {
  margin: 0;
  font-family: "Source Serif 4", serif;
  font-weight: 700;
  line-height: 1;
}

.timeline-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.compose-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.compose-link:hover,
.compose-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(29, 155, 240, 0.28);
}

.timeline-toolbar,
.pagination,
.post-top,
.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timeline-toolbar {
  align-items: center;
}

.result-count,
.page-indicator,
.post-summary,
.post-meta,
.comments-card p,
.reader-empty p,
.article-body {
  color: var(--muted);
  line-height: 1.7;
}

.comments-card a {
  color: #8fd0ff;
}

.comments-card a:hover,
.comments-card a:focus-visible {
  color: #b7e3ff;
}

.comments-thread {
  margin-top: 16px;
  min-height: 120px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.comments-thread .utterances {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
}

.comments-thread iframe,
.comments-thread .utterances-frame {
  display: block;
  width: 1px !important;
  min-width: 100% !important;
  max-width: 100% !important;
  border: 0;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.seo-post-links {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-card {
  border-radius: var(--radius-md);
  padding: 18px;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
  cursor: pointer;
  animation: card-enter 420ms ease both;
}

.post-card:hover,
.post-card.is-active {
  border-color: rgba(29, 155, 240, 0.36);
  background: #19202a;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}

.post-category {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--pill-border, rgba(245, 177, 76, 0.28));
  background: var(--pill-bg, rgba(245, 177, 76, 0.12));
  color: var(--pill-fg, #ffd48b);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.post-number {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-card h3 {
  margin: 10px 0 8px;
  font-size: 1.2rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.post-summary {
  margin: 0 0 14px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.9rem;
}

.pagination {
  align-items: center;
  justify-content: center;
  padding: 6px 0 0;
}

.pager-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.pager-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.reader-card {
  min-height: 0;
}

.reader-empty {
  display: grid;
  place-items: center;
  min-height: 52vh;
  text-align: center;
}

.reader-shell {
  width: 100%;
  min-width: 0;
}

.article-layout {
  display: grid;
  gap: 18px;
}

.article-layout > * {
  min-width: 0;
  max-width: 100%;
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(29, 155, 240, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 100%),
    #171d25;
}

.article-hero-copy {
  min-width: 0;
}

.article-actions {
  display: flex;
  align-items: start;
}

.article-subtitle {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.article-title {
  margin: 0 0 12px;
  max-width: none;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.article-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: 999px;
  background: rgba(29, 155, 240, 0.12);
  color: #dff2ff;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.article-link:hover,
.article-link:focus-visible {
  transform: translateY(-1px);
  background: rgba(29, 155, 240, 0.18);
  border-color: rgba(29, 155, 240, 0.4);
}

.article-link-static,
.article-link-static:hover,
.article-link-static:focus-visible {
  transform: none;
  cursor: default;
}

.article-meta-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.meta-group {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.meta-group strong {
  font-size: 1rem;
  line-height: 1.4;
}

.meta-group-wide {
  grid-column: 1 / -1;
}

.article-content-card {
  display: flex;
  justify-content: center;
  padding: 24px 22px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.01));
}

.article-body {
  width: 100%;
  max-width: 94ch;
  margin: 0 auto;
  color: #b8c4cf;
  font-size: 1.14rem;
  line-height: 1.92;
  overflow-wrap: anywhere;
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body > *:last-child {
  margin-bottom: 0;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem;
}

.article-body li + li {
  margin-top: 0.45rem;
}

.article-body img {
  display: block;
  max-width: 100%;
  margin: 1.5rem auto;
  border-radius: 18px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.65em 0 0.7em;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.article-body h1,
.article-body h2 {
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.6rem, 2.2vw, 2.15rem);
}

.article-body pre {
  overflow: auto;
  max-width: 100%;
  margin: 1.4rem 0;
  padding: 18px 20px;
  border-radius: 18px;
  background: #0d1117;
  border: 1px solid var(--line);
  color: #e6edf3;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.article-body pre code {
  display: block;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.article-body :not(pre) > code {
  padding: 0.16em 0.42em;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #c8f1ff;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: rgba(29, 155, 240, 0.08);
  border-radius: 0 16px 16px 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

.loading-state,
.no-results {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(10px);
  z-index: 40;
  animation: fade-in 220ms ease both;
}

.reader-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.reader-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-shell {
  width: min(1320px, 96vw);
  max-height: 88vh;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(17, 22, 28, 0.96);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.42);
  overflow-y: auto;
  transform: translateY(16px) scale(0.985);
  transition: transform 220ms ease;
}

.reader-modal.is-open .modal-shell {
  transform: translateY(0) scale(1);
}

.drawer-topbar {
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 16px;
  flex: 0 0 auto;
}

.drawer-topbar > div {
  margin-right: auto;
}

.drawer-close {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  color: #f6f8fb;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.drawer-close:hover,
.drawer-close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 14px 30px rgba(0, 0, 0, 0.24);
}

.modal-title {
  margin: 0;
  font-size: 1.7rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.22;
  }
}

@media (max-width: 1220px) {
  .app-shell {
    width: min(100% - 14px, 1580px);
    grid-template-columns: 272px minmax(0, 1fr);
  }

  .reader-modal {
    padding: 0;
  }

  .modal-shell {
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    padding: 0 14px 14px;
    gap: 14px;
  }

  .drawer-topbar {
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 -14px 0;
    padding: 14px 14px 8px;
    background: linear-gradient(180deg, rgba(17, 22, 28, 0.98), rgba(17, 22, 28, 0.92));
    backdrop-filter: blur(14px);
  }

  .drawer-topbar > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  .drawer-close {
    width: auto;
    min-width: 96px;
    min-height: 42px;
    align-self: flex-start;
  }

  .reader-card,
  .comments-card {
    flex: 0 0 auto;
    padding: 14px;
    border-radius: 18px;
  }

  .reader-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    height: auto;
    min-height: 0;
    align-self: stretch;
  }

  .article-layout {
    gap: 12px;
  }

  .article-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
  }

  .article-actions,
  .article-link {
    width: 100%;
  }

  .article-title {
    font-size: clamp(1.7rem, 4.2vw, 2.4rem);
    line-height: 1.02;
  }

  .article-subtitle {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .article-meta-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .meta-group {
    padding: 14px 16px;
    border-radius: 16px;
  }

  .article-content-card {
    display: block;
    padding: 16px 16px 20px;
    border-radius: 18px;
  }

  .article-body {
    max-width: none;
    font-size: 1.16rem;
    line-height: 1.92;
  }

  .article-body h1,
  .article-body h2 {
    font-size: clamp(1.35rem, 4vw, 1.9rem);
  }

  .article-body pre {
    padding: 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 10px, 1580px);
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .left-rail {
    position: static;
    order: 2;
  }

  .timeline-column {
    order: 1;
  }

  .timeline-header,
  .timeline-toolbar {
    flex-direction: column;
    align-items: start;
  }

  .timeline-header,
  .timeline-toolbar {
    gap: 14px;
  }

  .timeline-header > div,
  .compose-link {
    width: 100%;
  }

  .compose-link {
    min-height: 46px;
  }

  .timeline-toolbar,
  .pagination {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .page-size {
    width: 100%;
    justify-content: space-between;
  }

  .page-size select {
    min-width: 88px;
  }

  .post-list {
    gap: 12px;
  }

  .post-card {
    width: 100%;
    overflow: hidden;
  }

  .post-footer {
    flex-direction: column;
    align-items: start;
  }

  .post-tags {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }

  .pagination {
    gap: 10px;
  }

  .pager-button {
    flex: 1 1 0;
    min-width: 0;
  }

  .page-indicator {
    width: 100%;
    text-align: center;
  }

  .article-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .article-actions {
    width: 100%;
  }

  .article-link {
    width: 100%;
  }

  .article-title {
    max-width: none;
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .article-meta-panel {
    grid-template-columns: 1fr;
  }

  .article-content-card {
    display: block;
    padding: 18px 16px;
  }

  .article-body {
    max-width: none;
    font-size: 1.12rem;
    line-height: 1.88;
  }

  .reader-modal {
    padding: 0;
  }

  .modal-shell {
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 14px;
  }

  .reader-card,
  .comments-card {
    padding: 14px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: calc(100% - 8px);
    padding-top: 8px;
    gap: 10px;
  }

  .left-rail {
    gap: 10px;
    width: 100%;
  }

  .left-rail > * {
    width: 100%;
    min-width: 0;
  }

  .rail-card,
  .timeline-header,
  .post-card,
  .reader-card,
  .comments-card {
    border-radius: 18px;
  }

  .timeline-header {
    padding: 14px;
  }

  .timeline-header h1 {
    font-size: clamp(1.6rem, 8vw, 2.15rem);
    line-height: 1.02;
  }

  .timeline-toolbar {
    padding: 0 2px;
  }

  .result-count {
    font-size: 0.95rem;
  }

  .label-filters {
    gap: 8px;
  }

  .label-filters.is-collapsed-mobile .label-chip:nth-child(n + 6) {
    display: none;
  }

  .label-filters::-webkit-scrollbar,
  .post-tags::-webkit-scrollbar {
    display: none;
  }

  .brand-terminal {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    gap: 10px;
  }

  .brand-shell {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .brand-copy {
    font-size: 1.04rem;
    margin-bottom: 12px;
  }

  .post-card {
    padding: 16px;
  }

  .post-card h3 {
    font-size: 1.22rem;
    line-height: 1.18;
  }

  .post-summary {
    font-size: 0.98rem;
    line-height: 1.65;
    -webkit-line-clamp: 4;
  }

  .post-meta {
    gap: 6px 12px;
    font-size: 0.92rem;
  }

  .drawer-topbar {
    gap: 12px;
  }

  .modal-shell {
    padding: 0 12px 12px;
  }

  .drawer-topbar {
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 -12px 0;
    padding: 12px 12px 8px;
    background: linear-gradient(180deg, rgba(17, 22, 28, 0.98), rgba(17, 22, 28, 0.92));
    backdrop-filter: blur(14px);
  }

  .drawer-close {
    min-height: 42px;
    align-self: flex-start;
  }

  .modal-title {
    font-size: 1.42rem;
  }

  .article-hero {
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
  }

  .article-hero-copy .eyebrow {
    margin-bottom: 8px;
  }

  .article-subtitle {
    font-size: 0.95rem;
    line-height: 1.55;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .article-meta-panel {
    gap: 10px;
  }

  .meta-group {
    padding: 14px;
    border-radius: 16px;
  }

  .meta-group strong {
    font-size: 0.95rem;
  }

  .article-content-card {
    padding: 14px 12px 18px;
    border-radius: 18px;
  }

  .article-body {
    font-size: 1.08rem;
    line-height: 1.84;
  }

  .article-body p,
  .article-body ul,
  .article-body ol {
    margin-bottom: 1rem;
  }

  .article-body h1,
  .article-body h2 {
    font-size: clamp(1.3rem, 6vw, 1.7rem);
  }

  .article-body h3,
  .article-body h4 {
    font-size: 1.08rem;
  }

  .article-body pre {
    margin: 1.1rem 0;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .friend-links {
    gap: 8px;
  }

  .social-link,
  .friend-link {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 10px 12px;
  }

  .icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .ui-icon {
    width: 16px;
    height: 16px;
  }

  .friend-links.is-collapsed-mobile .friend-link:nth-child(n + 4) {
    display: none;
  }

  .labels-toggle,
  .friends-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .app-shell {
    width: calc(100% - 4px);
    padding-top: 6px;
    gap: 8px;
  }

  .timeline-header,
  .rail-card,
  .post-card,
  .reader-card,
  .comments-card {
    border-radius: 16px;
  }

  .timeline-header {
    padding: 12px;
  }

  .timeline-header h1 {
    font-size: 1.46rem;
  }

  .brand-shell {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .brand-terminal {
    min-height: 46px;
    padding: 0 12px;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-copy {
    font-size: 0.96rem;
  }

  .rail-card {
    padding: 14px;
  }

  .stats div {
    gap: 10px;
  }

  .label-chip,
  .tag-chip {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .social-link,
  .friend-link {
    padding: 9px 10px;
  }

  .post-card {
    padding: 14px;
  }

  .post-card h3 {
    font-size: 1.08rem;
  }

  .compose-link,
  .pager-button,
  .search-block input,
  .page-size select {
    min-height: 42px;
  }

  .reader-modal {
    padding: 0;
  }

  .modal-shell {
    padding: 0 10px 10px;
    gap: 10px;
    overflow-x: hidden;
  }

  .drawer-topbar {
    margin: 0 -10px 0;
    padding: 10px 10px 8px;
  }

  .drawer-topbar > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  .reader-card,
  .comments-card {
    padding: 12px;
    border-radius: 16px;
  }

  .comments-thread {
    margin-top: 12px;
  }

  .article-hero {
    padding: 14px;
  }

  .article-title {
    font-size: 1.42rem;
    line-height: 1.04;
  }

  .article-link {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.95rem;
    white-space: normal;
    text-align: center;
  }

  .article-content-card {
    padding: 12px 10px 16px;
  }

  .article-body {
    font-size: 1.04rem;
    line-height: 1.8;
  }

  .article-body blockquote {
    padding: 0.9rem 0.95rem;
    border-radius: 0 14px 14px 0;
  }

  .article-tags {
    gap: 8px;
  }

  .modal-title {
    font-size: 1.28rem;
  }

  .drawer-close {
    min-height: 40px;
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-column,
  .compose-link,
  .post-card,
  .drawer-overlay,
  .modal-shell {
    animation: none;
    transition: none;
  }
}
