.xp-card {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  width: 360px;
  max-width: calc(100vw - 16px);
  height: auto;
  max-height: min(520px, calc(100dvh - 16px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #405047;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.xp-card:popover-open { display: grid; }
:is(.social-x-post, .social-x-account)[aria-busy="true"] { position: relative; }
:is(.social-x-post, .social-x-account)[aria-busy="true"]::after { content: ""; position: absolute; right: -3px; bottom: -2px; width: 9px; height: 9px; border: 2px solid var(--muted); border-top-color: var(--text); border-radius: 50%; animation: xp-loading .8s linear infinite; }
@keyframes xp-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { :is(.social-x-post, .social-x-account)[aria-busy="true"]::after { animation: none; } }
.xp-card a { color: #8dcafa; }
.xp-card a:hover { text-decoration: underline; }
.xp-top { display: flex; gap: 8px; align-items: center; padding: 10px 12px; }
.xp-top strong { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.xp-top-actions { margin-left: auto; flex: none; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.xp-age { font-size: 11px; color: #ef9893; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xp-close, .xp-open { flex: none; display: grid; place-items: center; width: 28px; min-width: 28px; min-height: 28px; height: 28px; padding: 0; }
.xp-open svg, .xp-close svg { width: 18px; height: 18px; }
.xp-account-link { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.xp-account-link svg { width: 13px; height: 13px; fill: currentColor; }
.xp-avatar-link { flex: none; width: 40px; height: 40px; }
.xp-avatar { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.xp-avatar[hidden], .xp-banner[hidden] { display: none; }
.xp-banner { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.xp-profile .xp-top { padding: 12px; gap: 10px; }
.xp-profile .xp-avatar-link, .xp-profile .xp-avatar { width: 46px; height: 46px; }
.xp-profile .xp-author { flex: 1; }
.xp-profile .xp-account-link { width: 28px; height: 28px; color: var(--text); }
.xp-profile .xp-account-link svg { width: 18px; height: 18px; }
.xp-profile-meta { margin-top: 16px; color: #aab8b0; font-size: 12px; }
.xp-joined { display: flex; align-items: center; gap: 6px; }
.xp-joined svg { width: 15px; height: 15px; flex: none; }
.xp-profile-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.xp-profile-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.xp-profile-footer { display: block; padding: 0 12px 12px; }
.xp-profile-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; border: 1px solid #6c8175; border-radius: 5px; color: var(--text) !important; font-size: 13px; font-weight: 600; }
.xp-profile-button:hover { background: #ffffff0a; }
.xp-author { min-width: 0; }
.xp-author-name { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.xp-author-name a { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.xp-handle { display: block; color: #aab8b0 !important; font-size: 12px; overflow-wrap: anywhere; }
.xp-author-compact { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.xp-author-compact strong { font-size: 13px; }
.xp-verified { display: inline-flex; flex: none; width: 15px; height: 15px; }
.xp-verified svg { width: 15px; height: 15px; fill: currentColor; stroke: #102018; }
.xp-verified.blue { color: #55aff5; }
.xp-verified.business { color: #efcc68; }
.xp-verified.government, .xp-verified.legacy { color: #bdc6ce; }
.xp-affiliation { display: block; width: 17px; height: 17px; object-fit: contain; border-radius: 2px; }
.xp-account-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; color: #aab8b0; font-size: 12px; line-height: 20px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #ffffff18; }
.xp-account-meta span { display: inline-flex; align-items: center; gap: 5px; }
.xp-followers { margin-left: auto; }
.xp-account-meta b { color: var(--text); }
.xp-account-meta svg { width: 14px; height: 14px; }
.xp-scroll { min-height: 0; max-height: min(380px, calc(100dvh - 150px)); overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: #596b5b var(--surface); }
.xp-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; font-size: 14px; line-height: 1.5; }
.xp-text:empty { display: none; }
.xp-replying { margin: 0 0 12px; padding-left: 8px; border-left: 2px solid #bfcebf; font-size: 12px; color: #aab8b0; }
.xp-translation-label { display: block; font-size: 11px; color: #8dcafa; margin-bottom: 6px; }
.xp-translation { margin: 10px 0 12px; padding: 10px 12px; border-radius: 6px; background: #101310; }
.xp-translation .xp-text { margin-bottom: 0; }
.xp-translation-state { display: flex; align-items: center; gap: 6px; min-height: 28px; margin: 8px 0 12px; color: #aab8b0; font-size: 12px; }
.xp-translation-spinner { width: 12px; height: 12px; flex: none; border: 2px solid var(--muted); border-top-color: #8dcafa; border-radius: 50%; animation: xp-loading .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .xp-translation-spinner { animation: none; } }
.xp-status { display: flex; align-items: center; gap: 6px; min-height: 28px; margin-bottom: 10px; color: #aab8b0; font-size: 12px; }
.xp-retry { display: inline-grid; place-items: center; width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 0; }
.xp-retry svg { width: 14px; height: 14px; }
.xp-author-unavailable, .xp-reference-unavailable { color: #aab8b0; font-size: 12px; }
.xp-text-url { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.xp-url-run { display: inline-flex; max-width: 100%; align-items: baseline; vertical-align: bottom; }
.xp-url-run .xp-text-url { min-width: 0; }
.xp-url-run > span { flex: none; }
.xp-card figure { margin: 12px 0; }
.xp-card figure img, .xp-card video { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 4px; }
.xp-card figure img[hidden] { display: none; }
.xp-card video { min-height: 100px; background: #101310; }
.xp-card figcaption { color: var(--muted); font-size: 12px; }
.xp-card figure:not(.xp-reference-media) video { max-height: 250px; }
.xp-reference { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--surface) 88%, #718477); }
.xp-reference-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.xp-reference-time { margin-left: auto; flex: none; }
.xp-reference .xp-text { margin-bottom: 8px; font-size: 13px; }
.xp-reference-media { margin: 8px 0; }
.xp-reference-media video { max-height: 150px; }
.xp-link-preview { margin: 12px 0; }
.xp-link-card { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; color: var(--text) !important; background: #101310; }
.xp-link-card img { display: block; width: 100%; max-height: 150px; object-fit: cover; }
.xp-link-card span { position: absolute; right: 7px; bottom: 7px; left: 7px; padding: 3px 6px; overflow: hidden; border-radius: 3px; background: rgb(0 0 0 / 78%); color: #fff; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.xp-link-domain { display: block; margin-top: 4px; color: var(--muted) !important; font-size: 11px; }
.xp-article { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; margin: 0 0 12px; color: var(--text) !important; }
.xp-article img { display: block; width: 100%; max-height: 210px; object-fit: contain; }
.xp-article-copy { padding: 10px; }
.xp-article-copy strong { display: block; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.xp-article-copy p { margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; line-height: 1.5; }
.xp-article:hover { text-decoration: none !important; }
.xp-article:hover strong { text-decoration: underline; }
.xp-footer { display: block; padding: 0 12px; color: #aab8b0; font-size: 11px; }
.xp-published { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; }
.xp-published time { font-size: 11px; }
.xp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; padding: 8px 0; gap: 4px; border-top: 1px solid var(--line); }
.xp-metrics-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 0; padding: 6px 0 0; }
.xp-bottom { display: flex; align-items: center; border-top: 1px solid var(--line); gap: 6px; }
.xp-bottom .xp-metrics { flex: 1; min-width: 0; border-top: 0; }
.xp-bottom .xp-close { margin-left: auto; }
.xp-metric { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: #bacbbf; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; }
.xp-footer .xp-heart { color: #ef91b4; }
.xp-footer .xp-repeat-2 { color: #82cfa2; }
.xp-footer .xp-message-circle, .xp-footer .xp-bookmark { color: #8dcafa; }
.xp-metric svg { width: 15px; height: 15px; }
.xp-metric svg { flex: none; }
.xp-card :focus-visible { outline: 2px solid #8dcafa; outline-offset: 2px; }
@media (max-width: 380px) {
  .xp-scroll { padding: 11px; }
  .xp-metrics { padding: 0 6px; gap: 2px; }
  .xp-metric { font-size: 11px; gap: 2px; }
  .xp-metric svg { width: 13px; height: 13px; }
  .xp-top { gap: 6px; padding: 8px; }
  .xp-avatar-link, .xp-avatar { width: 32px; height: 32px; }
  .xp-metrics-compact { padding-right: 0; padding-left: 0; }
}
