/* ==========================================================================
   Waline x.com (Twitter) Style Theme
   ========================================================================== */
#waline {
  --waline-theme-color: #1d9bf0 !important;
  --waline-active-color: #1a8cd8 !important;
  --waline-color: #0f1419 !important;
  --waline-bg-color: #ffffff !important;
  --waline-bg-color-light: #eff3f4 !important;
  --waline-bg-color-hover: rgba(0, 0, 0, 0.02) !important;
  --waline-border-color: #eff3f4 !important;
  --waline-disable-bg-color: #eff3f4 !important;
  --waline-disable-color: #536471 !important;
  --waline-code-bg-color: #f7f9f9 !important;
  --waline-avatar-radius: 9999px !important;
  --waline-avatar-size: 40px !important;
  --waline-m-avatar-size: 36px !important;
  --waline-badge-color: #1d9bf0 !important;
  --waline-badge-font-size: 11px !important;
  --waline-info-bg-color: #eff3f4 !important;
  --waline-info-color: #536471 !important;
  --waline-border: 1px solid #eff3f4 !important;
  --waline-box-shadow: none !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

html.dark #waline {
  --waline-theme-color: #1d9bf0 !important;
  --waline-active-color: #1a8cd8 !important;
  --waline-color: #e7e9ea !important;
  --waline-bg-color: #000000 !important;
  --waline-bg-color-light: #16181c !important;
  --waline-bg-color-hover: rgba(255, 255, 255, 0.03) !important;
  --waline-border-color: #2f3336 !important;
  --waline-disable-bg-color: #16181c !important;
  --waline-disable-color: #71767b !important;
  --waline-code-bg-color: #16181c !important;
  --waline-avatar-radius: 9999px !important;
  --waline-badge-color: #1d9bf0 !important;
  --waline-info-bg-color: #16181c !important;
  --waline-info-color: #71767b !important;
  --waline-border: 1px solid #2f3336 !important;
  --waline-box-shadow: none !important;
}

/* X.com Style Composer Box */
#waline .wl-panel {
  border: 1px solid #eff3f4 !important;
  border-radius: 1.25rem !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  padding: 1rem 1.125rem !important;
  margin: 0 0 1.5rem 0 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

html.dark #waline .wl-panel {
  border-color: #2f3336 !important;
  background: #000000 !important;
  box-shadow: none !important;
}

#waline .wl-panel:focus-within {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 1px #1d9bf0 !important;
}

/* Guest Info Inputs - Sleek X Pills */
#waline .wl-header {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  border-bottom: none !important;
  padding: 0 0 0.75rem 0 !important;
  border-radius: 0 !important;
}

#waline .wl-header-item {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 160px !important;
  border: 1px solid #eff3f4 !important;
  border-radius: 9999px !important;
  background: #eff3f4 !important;
  padding: 0.25rem 0.75rem !important;
  transition: all 0.2s ease !important;
}

html.dark #waline .wl-header-item {
  border-color: #2f3336 !important;
  background: #16181c !important;
}

#waline .wl-header-item:focus-within {
  border-color: #1d9bf0 !important;
  background: transparent !important;
}

#waline .wl-header label {
  color: #536471 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  padding: 0 0.35rem 0 0 !important;
  min-width: auto !important;
}

html.dark #waline .wl-header label {
  color: #71767b !important;
}

#waline .wl-header input {
  color: #0f1419 !important;
  background: transparent !important;
  font-size: 0.8125rem !important;
  padding: 0.25rem 0 !important;
  border: none !important;
  outline: none !important;
  width: 100% !important;
}

html.dark #waline .wl-header input {
  color: #e7e9ea !important;
}

#waline .wl-header input::placeholder {
  color: #536471 !important;
  opacity: 0.8;
}

html.dark #waline .wl-header input::placeholder {
  color: #71767b !important;
}

/* Textarea Editor */
#waline .wl-editor {
  width: 100% !important;
  min-height: 5.5rem !important;
  margin: 0 !important;
  padding: 0.5rem 0.25rem !important;
  border: none !important;
  background: transparent !important;
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
  color: #0f1419 !important;
  resize: vertical !important;
  outline: none !important;
}

html.dark #waline .wl-editor {
  color: #e7e9ea !important;
}

#waline .wl-editor:focus {
  background: transparent !important;
}

#waline .wl-editor::placeholder {
  color: #536471 !important;
  font-size: 0.9375rem !important;
}

html.dark #waline .wl-editor::placeholder {
  color: #71767b !important;
}

/* Composer Footer Toolbar */
#waline .wl-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0.5rem 0 0 0 !important;
  padding-top: 0.75rem !important;
  border-top: 1px solid #eff3f4 !important;
}

html.dark #waline .wl-footer {
  border-top-color: #2f3336 !important;
}

#waline .wl-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  flex: 1 !important;
}

#waline .wl-action {
  width: 2.125rem !important;
  height: 2.125rem !important;
  border-radius: 9999px !important;
  color: #1d9bf0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease, transform 0.1s ease !important;
  cursor: pointer !important;
}

#waline .wl-action:hover {
  background-color: rgba(29, 155, 240, 0.1) !important;
  color: #1d9bf0 !important;
}

#waline .wl-action:active {
  background-color: rgba(29, 155, 240, 0.2) !important;
  transform: scale(0.95) !important;
}

#waline .wl-action.active {
  background-color: rgba(29, 155, 240, 0.15) !important;
  color: #1d9bf0 !important;
}

#waline .wl-info {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

#waline .wl-info .wl-text-number {
  color: #536471 !important;
  font-size: 0.8125rem !important;
  font-variant-numeric: tabular-nums !important;
}

html.dark #waline .wl-info .wl-text-number {
  color: #71767b !important;
}

/* Authentic X Pill "Post" (发布) Button */
#waline .wl-btn.primary {
  border-radius: 9999px !important;
  background: #1d9bf0 !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 0.45rem 1.25rem !important;
  line-height: 1.25 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(29, 155, 240, 0.2) !important;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
}

#waline .wl-btn.primary:hover {
  background: #1a8cd8 !important;
  box-shadow: 0 2px 8px rgba(29, 155, 240, 0.35) !important;
}

#waline .wl-btn.primary:active {
  transform: scale(0.97) !important;
}

#waline .wl-btn.primary:disabled {
  background: #1d9bf0 !important;
  opacity: 0.5 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

#waline .wl-btn:not(.primary) {
  border-radius: 9999px !important;
  border: 1px solid #eff3f4 !important;
  color: #536471 !important;
  font-weight: 600 !important;
  padding: 0.4rem 1rem !important;
  transition: all 0.2s ease !important;
}

html.dark #waline .wl-btn:not(.primary) {
  border-color: #2f3336 !important;
  color: #71767b !important;
}

#waline .wl-btn:not(.primary):hover {
  background: rgba(29, 155, 240, 0.08) !important;
  border-color: #1d9bf0 !important;
  color: #1d9bf0 !important;
}

/* Top Meta & Tabs Bar */
#waline .wl-meta-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.75rem 0.25rem !important;
  margin-bottom: 0.5rem !important;
  border-bottom: 1px solid #eff3f4 !important;
}

html.dark #waline .wl-meta-head {
  border-bottom-color: #2f3336 !important;
}

#waline .wl-count {
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: #0f1419 !important;
  letter-spacing: -0.01em !important;
}

html.dark #waline .wl-count {
  color: #e7e9ea !important;
}

#waline .wl-sort {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

#waline .wl-sort li {
  padding: 0.25rem 0.75rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #536471 !important;
  transition: all 0.2s ease !important;
}

html.dark #waline .wl-sort li {
  color: #71767b !important;
}

#waline .wl-sort li:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  color: #1d9bf0 !important;
}

#waline .wl-sort li.active {
  background: #1d9bf0 !important;
  color: #ffffff !important;
}

/* Timeline Feed Cards Stream */
#waline .wl-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

#waline .wl-card-item {
  position: relative !important;
  display: flex !important;
  padding: 1rem 0.5rem !important;
  border-bottom: 1px solid #eff3f4 !important;
  border-radius: 0.75rem !important;
  transition: background-color 0.15s ease !important;
}

html.dark #waline .wl-card-item {
  border-bottom-color: #2f3336 !important;
}

#waline .wl-card-item:hover {
  background-color: rgba(0, 0, 0, 0.015) !important;
}

html.dark #waline .wl-card-item:hover {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

#waline .wl-card-item:last-child {
  border-bottom: none !important;
}

#waline .wl-card {
  border-bottom: none !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Circular Avatars */
#waline .wl-user {
  margin-inline-end: 0.75rem !important;
  flex-shrink: 0 !important;
}

#waline .wl-user .wl-user-avatar,
#waline .wl-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: none !important;
  object-fit: cover !important;
  transition: opacity 0.2s ease !important;
}

html.dark #waline .wl-user .wl-user-avatar,
html.dark #waline .wl-avatar {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

#waline .wl-user .wl-user-avatar:hover,
#waline .wl-avatar:hover {
  opacity: 0.9 !important;
}

/* User Header & Nickname */
#waline .wl-head {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.35rem !important;
  line-height: 1.4 !important;
  margin-bottom: 0.25rem !important;
}

#waline .wl-nick {
  font-weight: 700 !important;
  font-size: 0.9375rem !important;
  color: #0f1419 !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

html.dark #waline .wl-nick {
  color: #e7e9ea !important;
}

#waline .wl-nick:hover {
  text-decoration: underline !important;
}

/* Verified Badge (X Style Blue Pill) */
#waline .wl-badge {
  display: inline-flex !important;
  align-items: center !important;
  background: #1d9bf0 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 1px 7px !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.02em !important;
}

#waline .wl-time {
  color: #536471 !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  margin-inline-end: 0.5rem !important;
}

html.dark #waline .wl-time {
  color: #71767b !important;
}

#waline .wl-time::before {
  content: "· ";
  margin-right: 2px;
}

/* Meta tags (Browser, OS, Location) */
#waline .wl-meta {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
  margin-bottom: 0.35rem !important;
}

#waline .wl-meta > span {
  background: rgba(83, 100, 113, 0.08) !important;
  color: #536471 !important;
  border-radius: 9999px !important;
  padding: 1px 7px !important;
  font-size: 0.6875rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  border: none !important;
}

html.dark #waline .wl-meta > span {
  background: rgba(113, 118, 123, 0.16) !important;
  color: #71767b !important;
}

/* Comment Body Content */
#waline .wl-content {
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
  color: #0f1419 !important;
  padding: 0.25rem 0 0.5rem 0 !important;
  margin-bottom: 0.35rem !important;
  word-break: break-word !important;
}

html.dark #waline .wl-content {
  color: #e7e9ea !important;
}

#waline .wl-content a {
  color: #1d9bf0 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

#waline .wl-content a:hover {
  text-decoration: underline !important;
}

#waline .wl-reply-to {
  color: #1d9bf0 !important;
  font-weight: 600 !important;
  margin-right: 0.35rem !important;
}

/* Action Icons (Reply, Like, Delete) - X Style */
#waline .wl-comment-actions {
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
  margin-top: 0.35rem !important;
}

#waline .wl-reply,
#waline .wl-like,
#waline .wl-delete,
#waline .wl-edit {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  color: #536471 !important;
  font-size: 0.8125rem !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 9999px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
}

html.dark #waline .wl-reply,
html.dark #waline .wl-like,
html.dark #waline .wl-delete,
html.dark #waline .wl-edit {
  color: #71767b !important;
}

#waline .wl-reply:hover {
  color: #1d9bf0 !important;
  background: rgba(29, 155, 240, 0.1) !important;
}

#waline .wl-like:hover {
  color: #f91880 !important;
  background: rgba(249, 24, 128, 0.1) !important;
}

#waline .wl-like.active {
  color: #f91880 !important;
  font-weight: 700 !important;
}

#waline .wl-delete:hover,
#waline .wl-edit:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* X Reply Threading Line */
#waline .wl-quote {
  border-left: 2px solid #eff3f4 !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  margin-left: 1.25rem !important;
  padding-left: 1rem !important;
  margin-top: 0.75rem !important;
  background: transparent !important;
}

html.dark #waline .wl-quote {
  border-left-color: #2f3336 !important;
}

/* Reactions Bar */
#waline .wl-reaction {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  margin-bottom: 1.5rem !important;
  padding: 0.75rem 0.25rem 1rem !important;
  border-bottom: 1px solid #eff3f4 !important;
  text-align: center !important;
}

html.dark #waline .wl-reaction {
  border-bottom-color: #2f3336 !important;
}

#waline .wl-reaction-title {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #536471 !important;
  margin: 0 auto 0.75rem !important;
  text-align: center !important;
}

html.dark #waline .wl-reaction-title {
  color: #71767b !important;
}

/* Reaction List: Mobile-first 3-column responsive grid (all 6 reactions fully visible) */
#waline .wl-reaction-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.5rem 0.375rem !important;
  padding: 0.25rem 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  list-style: none !important;
  box-sizing: border-box !important;
}

/* Reaction Item: Touch-friendly card */
#waline .wl-reaction-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 0.25rem !important;
  border-radius: 0.875rem !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: background-color 0.2s ease, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#waline .wl-reaction-item:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  transform: translateY(-2px) !important;
}

html.dark #waline .wl-reaction-item:hover {
  background: rgba(29, 155, 240, 0.14) !important;
}

#waline .wl-reaction-item:active {
  transform: scale(0.95) !important;
  background: rgba(29, 155, 240, 0.12) !important;
}

#waline .wl-reaction-item.active {
  background: rgba(29, 155, 240, 0.1) !important;
  outline: 1.5px solid rgba(29, 155, 240, 0.4) !important;
}

html.dark #waline .wl-reaction-item.active {
  background: rgba(29, 155, 240, 0.18) !important;
  outline-color: rgba(29, 155, 240, 0.55) !important;
}

/* Reaction Emoji Image */
#waline .wl-reaction-img {
  position: relative !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

#waline .wl-reaction-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#waline .wl-reaction-item:hover .wl-reaction-img img,
#waline .wl-reaction-item.active .wl-reaction-img img {
  transform: scale(1.15) !important;
}

/* Reaction Vote Count Badge */
#waline .wl-reaction-votes {
  position: absolute !important;
  top: -5px !important;
  right: -8px !important;
  inset-inline-end: -8px !important;
  background: #1d9bf0 !important;
  color: #ffffff !important;
  border: 1.5px solid #ffffff !important;
  border-radius: 9999px !important;
  padding: 0 5px !important;
  min-width: 16px !important;
  height: 16px !important;
  line-height: 13px !important;
  font-size: 0.625rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

html.dark #waline .wl-reaction-votes {
  border-color: #000000 !important;
}

/* Reaction Text Label */
#waline .wl-reaction-text {
  font-size: 0.75rem !important;
  line-height: 1.25 !important;
  color: #536471 !important;
  margin-top: 0.35rem !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  transition: color 0.2s ease !important;
}

html.dark #waline .wl-reaction-text {
  color: #71767b !important;
}

#waline .wl-reaction-item:hover .wl-reaction-text,
#waline .wl-reaction-item.active .wl-reaction-text {
  color: #1d9bf0 !important;
  font-weight: 700 !important;
}

/* Reaction Loading Spinner */
#waline .wl-reaction-loading {
  position: absolute !important;
  top: -4px !important;
  right: -5px !important;
  inset-inline-end: -5px !important;
  width: 18px !important;
  height: 18px !important;
  color: #1d9bf0 !important;
}

/* Extra small mobile screens (< 350px) */
@media (max-width: 350px) {
  #waline .wl-reaction-text {
    font-size: 0.6875rem !important;
  }
  #waline .wl-reaction-img {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Tablet & Desktop (>= 640px): Switch to single centered horizontal row */
@media (min-width: 640px) {
  #waline .wl-reaction {
    padding: 1rem 0.5rem !important;
    margin-bottom: 2rem !important;
  }

  #waline .wl-reaction-title {
    font-size: 0.9375rem !important;
    margin-bottom: 1rem !important;
  }

  #waline .wl-reaction-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.875rem !important;
    padding: 0.5rem 0 !important;
    max-width: 720px !important;
  }

  #waline .wl-reaction-item {
    flex: 0 1 auto !important;
    min-width: 76px !important;
    padding: 0.625rem 0.875rem !important;
    border-radius: 1rem !important;
  }

  #waline .wl-reaction-img {
    width: 40px !important;
    height: 40px !important;
  }

  #waline .wl-reaction-text {
    font-size: 0.8125rem !important;
    margin-top: 0.45rem !important;
  }
}

@media (min-width: 768px) {
  #waline .wl-reaction-list {
    gap: 1.25rem !important;
  }
  #waline .wl-reaction-img {
    width: 42px !important;
    height: 42px !important;
  }
}

/* Popups (Emoji / GIF) */
#waline .wl-emoji-popup,
#waline .wl-gif-popup {
  border: 1px solid #eff3f4 !important;
  border-radius: 1rem !important;
  background: #ffffff !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

html.dark #waline .wl-emoji-popup,
html.dark #waline .wl-gif-popup {
  border-color: #2f3336 !important;
  background: #16181c !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
}

#waline .wl-emoji-popup .wl-tab.active {
  border-bottom: 2px solid #1d9bf0 !important;
  color: #1d9bf0 !important;
  background: transparent !important;
}

/* Load More Button */
#waline .wl-operation button {
  border-radius: 9999px !important;
  border: 1px solid #eff3f4 !important;
  background: transparent !important;
  color: #1d9bf0 !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 0.5rem 1.5rem !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

html.dark #waline .wl-operation button {
  border-color: #2f3336 !important;
}

#waline .wl-operation button:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  border-color: #1d9bf0 !important;
}

/* Empty State */
#waline .wl-empty {
  color: #536471 !important;
  padding: 2.5rem 1rem !important;
  font-size: 0.9375rem !important;
}

html.dark #waline .wl-empty {
  color: #71767b !important;
}

/* Powered by Waline */
#waline .wl-power {
  color: #536471 !important;
  font-size: 0.6875rem !important;
  opacity: 0.7 !important;
  margin-top: 1rem !important;
}

html.dark #waline .wl-power {
  color: #71767b !important;
}

#waline .wl-power a {
  color: #1d9bf0 !important;
}

/* ==========================================================================
   Waline Comments Markdown Rendering Styles (.wl-content & .wl-preview)
   ========================================================================== */
#waline .wl-content,
#waline .wl-preview {
  line-height: 1.8 !important;
  font-size: 0.9375rem !important;
  color: #0f1419 !important;
  word-break: break-word !important;
}

html.dark #waline .wl-content,
html.dark #waline .wl-preview {
  color: #e7e9ea !important;
}

#waline .wl-content p,
#waline .wl-preview p {
  margin-top: 0.75em !important;
  margin-bottom: 0.75em !important;
  line-height: 1.7 !important;
}

#waline .wl-content p:first-child,
#waline .wl-preview p:first-child {
  margin-top: 0 !important;
}

#waline .wl-content p:last-child,
#waline .wl-preview p:last-child {
  margin-bottom: 0 !important;
}

/* Headings */
#waline .wl-content h1, #waline .wl-content h2, #waline .wl-content h3, #waline .wl-content h4, #waline .wl-content h5, #waline .wl-content h6,
#waline .wl-preview h1, #waline .wl-preview h2, #waline .wl-preview h3, #waline .wl-preview h4, #waline .wl-preview h5, #waline .wl-preview h6 {
  font-weight: 700 !important;
  margin-top: 1.25em !important;
  margin-bottom: 0.5em !important;
  line-height: 1.3 !important;
  color: #0f1419 !important;
}

html.dark #waline .wl-content h1, html.dark #waline .wl-content h2, html.dark #waline .wl-content h3, html.dark #waline .wl-content h4, html.dark #waline .wl-content h5, html.dark #waline .wl-content h6,
html.dark #waline .wl-preview h1, html.dark #waline .wl-preview h2, html.dark #waline .wl-preview h3, html.dark #waline .wl-preview h4, html.dark #waline .wl-preview h5, html.dark #waline .wl-preview h6 {
  color: #ffffff !important;
}

#waline .wl-content h1, #waline .wl-preview h1 { font-size: 1.4rem !important; border-bottom: 1px solid #eff3f4; padding-bottom: 0.3em; }
#waline .wl-content h2, #waline .wl-preview h2 { font-size: 1.25rem !important; border-bottom: 1px solid #eff3f4; padding-bottom: 0.3em; }
#waline .wl-content h3, #waline .wl-preview h3 { font-size: 1.1rem !important; }
#waline .wl-content h4, #waline .wl-preview h4 { font-size: 1rem !important; }
#waline .wl-content h5, #waline .wl-preview h5 { font-size: 0.9375rem !important; }
#waline .wl-content h6, #waline .wl-preview h6 { font-size: 0.875rem !important; color: #536471 !important; }

html.dark #waline .wl-content h1, html.dark #waline .wl-preview h1,
html.dark #waline .wl-content h2, html.dark #waline .wl-preview h2 {
  border-bottom-color: #2f3336 !important;
}

/* Lists */
#waline .wl-content ul,
#waline .wl-preview ul {
  list-style-type: disc !important;
  margin-top: 0.6em !important;
  margin-bottom: 0.6em !important;
  padding-left: 1.5em !important;
}

#waline .wl-content ol,
#waline .wl-preview ol {
  list-style-type: decimal !important;
  margin-top: 0.6em !important;
  margin-bottom: 0.6em !important;
  padding-left: 1.5em !important;
}

#waline .wl-content li,
#waline .wl-preview li {
  margin-top: 0.3em !important;
  margin-bottom: 0.3em !important;
  display: list-item !important;
  line-height: 1.6 !important;
}

#waline .wl-content ul ul, #waline .wl-content ol ul,
#waline .wl-preview ul ul, #waline .wl-preview ol ul {
  list-style-type: circle !important;
}

#waline .wl-content ol ol,
#waline .wl-preview ol ol {
  list-style-type: lower-roman !important;
}

/* Task lists */
#waline .wl-content input[type="checkbox"],
#waline .wl-preview input[type="checkbox"] {
  margin: 0 0.4em 0.2em -1.2em !important;
  vertical-align: middle !important;
  accent-color: #1d9bf0 !important;
}

/* Blockquote */
#waline .wl-content blockquote,
#waline .wl-preview blockquote {
  border-left: 4px solid #1d9bf0 !important;
  background: rgba(29, 155, 240, 0.05) !important;
  padding: 0.6rem 1rem !important;
  margin: 0.85em 0 !important;
  border-radius: 0 0.5rem 0.5rem 0 !important;
  color: inherit !important;
  font-style: italic !important;
}

html.dark #waline .wl-content blockquote,
html.dark #waline .wl-preview blockquote {
  background: rgba(29, 155, 240, 0.08) !important;
  border-left-color: #1d9bf0 !important;
}

#waline .wl-content blockquote p,
#waline .wl-preview blockquote p {
  margin: 0.25em 0 !important;
}

/* Inline Code */
#waline .wl-content code,
#waline .wl-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.85em !important;
  padding: 0.2em 0.45em !important;
  border-radius: 6px !important;
  background: rgba(29, 155, 240, 0.08) !important;
  color: #1d9bf0 !important;
  border: 1px solid rgba(29, 155, 240, 0.15) !important;
}

html.dark #waline .wl-content code,
html.dark #waline .wl-preview code {
  background: rgba(29, 155, 240, 0.12) !important;
  color: #78c8f9 !important;
  border-color: rgba(29, 155, 240, 0.25) !important;
}

/* Code Blocks */
#waline .wl-content pre,
#waline .wl-preview pre {
  margin: 0.9em 0 !important;
  padding: 0.9rem 1.1rem !important;
  border-radius: 0.85rem !important;
  background: #16181c !important;
  border: 1px solid #2f3336 !important;
  overflow-x: auto !important;
}

#waline .wl-content pre code,
#waline .wl-preview pre code {
  padding: 0 !important;
  background: transparent !important;
  color: #e7e9ea !important;
  font-size: 0.85rem !important;
  border: none !important;
}

/* Links */
#waline .wl-content a,
#waline .wl-preview a {
  color: #1d9bf0 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  font-weight: 500 !important;
}

#waline .wl-content a:hover,
#waline .wl-preview a:hover {
  text-decoration-thickness: 2px !important;
}

/* Strong, Italic, Del */
#waline .wl-content strong, #waline .wl-content b,
#waline .wl-preview strong, #waline .wl-preview b {
  font-weight: 700 !important;
}

#waline .wl-content em, #waline .wl-content i,
#waline .wl-preview em, #waline .wl-preview i {
  font-style: italic !important;
}

#waline .wl-content del, #waline .wl-content s,
#waline .wl-preview del, #waline .wl-preview s {
  text-decoration: line-through !important;
  opacity: 0.75 !important;
}

/* Horizontal Rule */
#waline .wl-content hr,
#waline .wl-preview hr {
  border: none !important;
  border-top: 1px solid #eff3f4 !important;
  margin: 1.25em 0 !important;
}

html.dark #waline .wl-content hr,
html.dark #waline .wl-preview hr {
  border-top-color: #2f3336 !important;
}

/* Images inside comments (excluding emojis) */
#waline .wl-content img:not(.wl-emoji):not(.vemoji),
#waline .wl-preview img:not(.wl-emoji):not(.vemoji) {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.75rem !important;
  margin: 0.75em 0 !important;
  display: block !important;
}

/* Emojis inside comments & preview - keep inline and flowing naturally */
#waline .wl-content .wl-emoji,
#waline .wl-content .vemoji,
#waline .wl-content img.wl-emoji,
#waline .wl-content img.vemoji,
#waline .wl-preview .wl-emoji,
#waline .wl-preview .vemoji,
#waline .wl-preview img.wl-emoji,
#waline .wl-preview img.vemoji {
  display: inline-block !important;
  vertical-align: -0.22em !important;
  height: 1.4em !important;
  width: auto !important;
  max-width: 2em !important;
  max-height: 2em !important;
  margin: 0 0.15em !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* If line break exists strictly between consecutive emojis, collapse it so they flow inline */
#waline .wl-content .wl-emoji + br:has(+ .wl-emoji),
#waline .wl-content .vemoji + br:has(+ .vemoji),
#waline .wl-preview .wl-emoji + br:has(+ .wl-emoji),
#waline .wl-preview .vemoji + br:has(+ .vemoji) {
  display: none !important;
}

/* Tables */
#waline .wl-content table,
#waline .wl-preview table {
  width: 100% !important;
  margin: 1em 0 !important;
  border-collapse: collapse !important;
}

#waline .wl-content th,
#waline .wl-content td,
#waline .wl-preview th,
#waline .wl-preview td {
  border: 1px solid #eff3f4 !important;
  padding: 0.5rem 0.75rem !important;
  text-align: left !important;
}

html.dark #waline .wl-content th,
html.dark #waline .wl-content td,
html.dark #waline .wl-preview th,
html.dark #waline .wl-preview td {
  border-color: #2f3336 !important;
}

#waline .wl-content th,
#waline .wl-preview th {
  background: rgba(83, 100, 113, 0.08) !important;
  font-weight: 600 !important;
}

html.dark #waline .wl-content th,
html.dark #waline .wl-preview th {
  background: rgba(113, 118, 123, 0.16) !important;
}
