.work-card--thread {
  justify-content: flex-start;
}

.work-card--thread img.work-thumb {
  padding: 4px;
  background:
    radial-gradient(circle at 24% 18%, var(--image-matte-glow-pink), transparent 34%),
    radial-gradient(circle at 82% 24%, var(--image-matte-glow-blue), transparent 38%),
    linear-gradient(135deg, var(--image-matte-soft), var(--image-matte));
  object-fit: contain;
  object-position: center center;
}

.thread-index-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  width: calc(100vw - clamp(18px, 5vw, 76px) - clamp(18px, 4vw, 54px));
  max-width: none;
}

.thread-index-title-row h1 {
  margin: 0;
}

.thread-auto-refresh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  width: fit-content;
  min-height: 2rem;
  margin-left: auto;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  padding: 0.36rem 0.74rem;
  background: rgba(240, 253, 250, 0.8);
  color: #0f766e;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.thread-auto-refresh-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #0f766e;
}

.thread-index-lead:empty {
  display: none;
}

.thread-article-shell {
  max-width: 920px;
  margin: 0 auto;
}

.thread-article-tags {
  margin-bottom: 18px;
}

.thread-post-list {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.thread-post {
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  padding: 18px;
}

.thread-post--reaction-top {
  border-color: rgba(220, 38, 38, 0.26);
  background: rgba(255, 247, 247, 0.92);
}

.thread-post-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.thread-post-head-left {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.thread-post-order {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.1;
}

.thread-post-head-left strong {
  color: var(--text);
  font-weight: 700;
}

.thread-post-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
  text-align: right;
  flex: 0 0 auto;
}

.thread-post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
  gap: 12px;
  margin: 10px 0 14px;
}

.thread-post-image {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.thread-post-image a {
  display: block;
}

.thread-post-image img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
}

.thread-post-body {
  color: var(--text);
  line-height: 1.9;
}

.thread-post-body p {
  margin: 0;
}

.thread-post-body p + p {
  margin-top: 0.55em;
}

.thread-post-body a {
  overflow-wrap: anywhere;
}

.thread-reaction-body-line {
  color: #b91c1c;
  font-size: 1.08rem;
  font-weight: 700;
}

.thread-quote {
  color: #15803d;
  font-size: 1rem;
  font-weight: 500;
}

.thread-embed {
  margin: 10px 0 4px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.thread-embed[hidden] {
  display: none;
}

.thread-embed--youtube {
  aspect-ratio: 16 / 9;
  max-width: 620px;
}

.thread-embed--youtube iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.thread-embed--x {
  max-width: 620px;
  padding: 12px 14px;
}

.thread-embed--x .twitter-tweet {
  margin: 0 !important;
}

.thread-embed--amazon {
  max-width: 620px;
  background: rgba(255, 255, 255, 0.86);
}

.thread-amazon-card-link {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.thread-amazon-card-link:hover {
  text-decoration: none;
}

.thread-amazon-card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 18%, var(--image-matte-glow-pink), transparent 34%),
    radial-gradient(circle at 82% 24%, var(--image-matte-glow-blue), transparent 38%),
    linear-gradient(135deg, var(--image-matte-soft), var(--image-matte));
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.thread-amazon-card-thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.thread-amazon-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.thread-amazon-card-label {
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-amazon-card-title {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.55;
}

.thread-amazon-card-asin {
  color: var(--muted);
  font-size: 0.78rem;
}

.thread-amazon-card-cta {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
}

.thread-embed--link-preview {
  max-width: 620px;
  background: rgba(255, 255, 255, 0.88);
}

.thread-link-preview-card {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.thread-link-preview-card:hover {
  text-decoration: none;
  background: rgba(248, 250, 252, 0.9);
}

.thread-link-preview-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 132px;
  overflow: hidden;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(circle at 24% 18%, var(--image-matte-glow-pink), transparent 34%),
    radial-gradient(circle at 82% 24%, var(--image-matte-glow-blue), transparent 38%),
    linear-gradient(135deg, var(--image-matte-soft), var(--image-matte));
}

.thread-link-preview-thumb-placeholder {
  max-width: 90%;
  padding: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
}

.thread-link-preview-thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.thread-link-preview-body {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
}

.thread-link-preview-site,
.thread-link-preview-title,
.thread-link-preview-description,
.thread-link-preview-url,
.thread-link-preview-cta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.thread-link-preview-site {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.thread-link-preview-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.thread-link-preview-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.thread-link-preview-url {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-link-preview-cta {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.thread-embed-label {
  margin: 0 0 6px !important;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.thread-back-link {
  margin-top: 30px;
}

@media (max-width: 640px) {
  .thread-index-title-row {
    align-items: center;
    width: 100%;
  }

  .thread-auto-refresh-toggle {
    font-size: 0.82rem;
  }

  .thread-post-head {
    gap: 8px;
  }

  .thread-post-date {
    text-align: right;
    white-space: normal;
  }

  .thread-post-images {
    grid-template-columns: 1fr;
  }

  .thread-amazon-card-link {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .thread-amazon-card-thumb {
    width: 86px;
    height: 86px;
  }

  .thread-amazon-card-title {
    font-size: 0.92rem;
  }

  .thread-link-preview-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .thread-link-preview-thumb {
    min-height: 118px;
  }

  .thread-link-preview-body {
    padding: 12px;
  }

  .thread-link-preview-description {
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 460px) {
  .thread-link-preview-card {
    grid-template-columns: 1fr;
  }

  .thread-link-preview-thumb {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .thread-link-preview-description {
    -webkit-line-clamp: 3;
  }
}