/* X post page recreation. Values measured from x.com post pages (logged out, Nov 2026). */
.x {
  --x-bg: #000;
  --x-text: #fff;
  --x-dim: #999;
  --x-line: rgba(255, 255, 255, 0.15);
  --x-line-strong: rgba(255, 255, 255, 0.2);
  --x-hover: rgba(255, 255, 255, 0.03);
  --x-blue: #1d9bf0;
  --x-pink: #f91880;
  --x-green: #00ba7c;
  --x-media: #16181c;
  position: relative;
  max-width: 600px;
  background: var(--x-bg);
  color: var(--x-text);
  border: 1px solid var(--x-line);
  border-radius: 16px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 15px;
  line-height: 20px;
  font-weight: 400;
  font-feature-settings: normal;
  letter-spacing: normal;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] .x {
  --x-bg: #fff;
  --x-text: #000;
  --x-dim: #666;
  --x-line: rgba(0, 0, 0, 0.15);
  --x-line-strong: rgba(0, 0, 0, 0.2);
  --x-hover: rgba(0, 0, 0, 0.03);
  --x-media: #f7f9f9;
}
.x a { color: inherit; text-decoration: none; }
.x a:hover { text-decoration: underline; }
/* Zero specificity reset, so .x-act and friends keep their own padding and colour. */
:where(.x) button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; }
:where(.x) button:not([class]) { color: inherit; }
.x svg { display: block; fill: currentColor; }

.x-top {
  display: flex;
  align-items: center;
  gap: 34px;
  height: 53px;
  padding: 0 16px;
}
.x-top b { font-size: 20px; line-height: 24px; font-weight: 700; }
.x-top svg { width: 20px; height: 20px; }

/* Avatars. */
.x-av {
  position: relative;
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--x-media);
}
.x-av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.x-av .ini {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 17px;
  font-weight: 700;
  color: var(--x-dim);
}

.x-name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-weight: 700; }
.x-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-badge { width: 15px; height: 15px; flex: none; }
.x-dim { color: var(--x-dim); }
.x-more {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -8px -8px -8px 0;
  border-radius: 9999px;
  color: var(--x-dim);
  transition: background-color 200ms, color 200ms;
}
.x-more svg { width: 16px; height: 16px; }
.x-more:hover { background: rgba(29, 155, 240, 0.1); color: var(--x-blue); }

/* Focal post. */
.x-focal { padding: 12px 16px; border-bottom: 1px solid var(--x-line-strong); }
.x-head { display: flex; align-items: center; gap: 8px; }
.x-head .who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.x-head .who .x-dim { line-height: 20px; }
.x-focal .x-text {
  font-size: 17px;
  line-height: 24px;
}
.x-text { white-space: pre-wrap; overflow-wrap: break-word; }
.x-text a.lk, .x-link { color: var(--x-blue); }
.x-text.greentext { font-family: var(--mono, ui-monospace, Menlo, monospace); font-size: 15px; line-height: 22px; }
.x-focal .x-text.greentext { font-size: 15.5px; line-height: 24px; }
.x-showmore {
  display: block;
  margin-top: 2px;
  color: var(--x-blue);
  font-size: inherit;
  line-height: inherit;
}
.x-showmore:hover { text-decoration: underline; }

.x-media {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--x-line);
  border-radius: 16px;
  background: var(--x-media);
  overflow: hidden;
}
.x-media .slot { border: 0; border-radius: 0; background: transparent; height: 100%; }
.x-media-file { display: block; width: 100%; height: auto; object-fit: cover; }
.x-media .slot-label { color: var(--x-dim); font-family: inherit; font-size: 15px; }
.x-media .play {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 9999px;
  background: var(--x-blue);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.x-media .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.x-media .play.on-poster { position: absolute; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); }
.x-media .dur {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.77);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
}

.x-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  color: var(--x-dim);
}
.x-meta .dot { padding: 0 4px; }
.x-meta .views { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 16px; }
.x-meta .views b { color: var(--x-text); font-weight: 700; }

/* Action rows. */
.x-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 0 -8px;
  height: 20px;
}
.x-focal .x-actions { margin-top: 20px; }
.x-act-col { flex: 1; display: flex; }
.x-act-end { display: flex; }
.x-act {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  margin: -10px 0;
  border-radius: 9999px;
  color: var(--x-dim);
  transition: color 200ms;
}
.x-act .ic { position: relative; display: grid; place-items: center; }
.x-act .ic::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 9999px;
  background: transparent;
  transition: background-color 200ms;
}
.x-act svg { position: relative; width: 20px; height: 20px; }
.x-act .n {
  position: relative;
  display: inline-flex;
  height: 16px;
  padding-left: 4px;
  font-size: 13px;
  line-height: 16px;
  overflow: hidden;
  min-width: 1ch;
}
.x-act .n span { display: block; }
.x-reply .x-act { height: 36px; padding: 0 10px; margin: -8px 0; }
.x-reply .x-act svg { width: 18.75px; height: 18.75px; }

.x-act[data-a="reply"]:hover, .x-act[data-a="views"]:hover, .x-act[data-a="share"]:hover, .x-act[data-a="bookmark"]:hover { color: var(--x-blue); }
.x-act[data-a="reply"]:hover .ic::before, .x-act[data-a="views"]:hover .ic::before, .x-act[data-a="share"]:hover .ic::before, .x-act[data-a="bookmark"]:hover .ic::before { background: rgba(29, 155, 240, 0.1); }
.x-act[data-a="repost"]:hover, .x-act[data-a="repost"][aria-pressed="true"] { color: var(--x-green); }
.x-act[data-a="repost"]:hover .ic::before { background: rgba(0, 186, 124, 0.1); }
.x-act[data-a="like"]:hover, .x-act[data-a="like"][aria-pressed="true"] { color: var(--x-pink); }
.x-act[data-a="like"]:hover .ic::before { background: rgba(249, 24, 128, 0.1); }
.x-act[data-a="bookmark"][aria-pressed="true"] { color: var(--x-blue); }

.x-act .fill { display: none; }
.x-act[aria-pressed="true"] .fill { display: block; }
.x-act[aria-pressed="true"] .outline { display: none; }
.x-act.pop svg { animation: x-pop 320ms cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes x-pop {
  0% { transform: scale(0.72); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.x-act .n .roll { animation: x-roll-in 240ms var(--ease-out, ease-out); }
.x-act .n .roll-down { animation: x-roll-down 240ms var(--ease-out, ease-out); }
@keyframes x-roll-in { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes x-roll-down { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* Self replies joined by the thread line. */
.x-reply {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  transition: background-color 200ms;
}
.x-reply:hover { background: var(--x-hover); }
.x-reply .rail { position: relative; display: flex; flex-direction: column; align-items: center; flex: none; width: 40px; }
.x-reply .line {
  flex: 1;
  width: 2px;
  margin: 4px 0 -12px;
  border-radius: 9999px 9999px 0 0;
  background: var(--x-line);
}
.x-reply .body { flex: 1; min-width: 0; }
.x-reply .rh { display: flex; align-items: center; gap: 4px; height: 20px; color: var(--x-dim); min-width: 0; }
.x-reply .rh .x-name { color: var(--x-text); }
.x-reply .rh .hn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.x-reply .rh .x-more { margin-left: auto; }
.x-reply .x-text { margin-top: 2px; }
.x-reply .x-media { margin-top: 12px; }
.x-reply.is-last { border-bottom: 1px solid var(--x-line); }

.x-showreplies {
  display: block;
  width: 100%;
  padding: 16px;
  text-align: left;
  color: var(--x-blue);
  border-bottom: 1px solid var(--x-line);
  transition: background-color 200ms;
}
.x-showreplies:hover { background: var(--x-hover); }
.x-sr-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 260ms var(--ease-out, ease-out), opacity 160ms var(--ease-out, ease-out); }
.x-sr-wrap > div { overflow: hidden; min-height: 0; }
.x-sr-wrap.is-gone { grid-template-rows: 0fr; opacity: 0; }
.x-hidden-reply { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms var(--ease-out, ease-out); }
.x-hidden-reply > div { overflow: hidden; }
.x-hidden-reply.is-open { grid-template-rows: 1fr; }
.x-hidden-reply .x-reply { border-bottom: 1px solid var(--x-line); }


@media (max-width: 420px) {
  .x { border-radius: 0; border-left: 0; border-right: 0; margin: 0 -20px; }
  .x-act { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .x-act.pop svg, .x-act .n .roll, .x-act .n .roll-down { animation: none; }
  .x-hidden-reply, .x-sr-wrap { transition: none; }
}
