/* Twitter Card Validator - tool-specific styles on top of the shared
 * tools.css primitives (results region, table, history, toasts). Sibling
 * of the Pinterest Rich Pins Validator's tool.css plus the X post mock
 * with the card preview. */

:root { --tcv-accent: #1d9bf0; --tcv-accent-dark: #0c7abf; --tcv-accent-tint: #eaf6fe; }

.page-hero h1 .tcv-hero-mark { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: 0.4rem; color: var(--tcv-accent); }

.tcv-intro { margin: 0 0 14px; color: #475569; font-size: 0.95rem; line-height: 1.55; }
.tcv-input-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tcv-input-row .text-input { flex: 1 1 320px; min-width: 0; }
.tcv-error { margin: 10px 0 0; color: #b91c1c; font-size: 0.9rem; }
.tcv-error[hidden] { display: none; }
.tcv-fix-link { text-decoration: none; }

.tcv-report { padding: 16px 18px 18px; }
.tcv-subhead { font-size: 0.92rem; color: #475569; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }
.tcv-subhead strong { color: #1f2937; }
.tcv-subhead a { color: var(--tcv-accent-dark); }
.tcv-subhead-note { color: #94a3b8; }
.tcv-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.tcv-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em;
}
.tcv-pill.is-pass { background: #dcfce7; color: #166534; }
.tcv-pill.is-warn { background: #fef3c7; color: #92400e; }
.tcv-pill.is-fail { background: #fee2e2; color: #991b1b; }
.tcv-pill.is-info { background: #e0f2fe; color: #075985; }
.tcv-pill.is-kind { background: var(--tcv-accent-tint); color: var(--tcv-accent-dark); }

.tcv-group, .tcv-preview-wrap, .tcv-resolved-wrap, .tcv-tags-wrap { margin-top: 18px; }
.tcv-tags-wrap[hidden] { display: none; }
.tcv-group-title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: #1f2937; }
.tcv-group-note { margin: 0 0 8px; font-size: 0.84rem; color: #64748b; }
.tcv-row {
    display: grid; grid-template-columns: 82px minmax(0, 1fr);
    gap: 4px 12px; padding: 10px 0; border-top: 1px solid #eef0f3;
}
.tcv-row:first-of-type { border-top: 0; }
.tcv-row-status { align-self: start; }
.tcv-row-label { font-weight: 600; color: #1f2937; font-size: 0.93rem; }
.tcv-row-detail { grid-column: 2; font-size: 0.88rem; color: #475569; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }
.tcv-row-fix { grid-column: 2; font-size: 0.84rem; color: #0b4f7a; background: var(--tcv-accent-tint); border-radius: 8px; padding: 6px 10px; line-height: 1.5; }
.tcv-row-fix code, .tcv-row-detail code { font-size: 0.82em; background: #f5f6f8; padding: 1px 4px; border-radius: 4px; word-break: break-all; }

/* ---- The X post mock with the card ---- */
.tcv-post { max-width: 560px; display: flex; gap: 12px; border: 1px solid #e6e8eb; border-radius: 16px; padding: 14px 16px 14px; background: #fff; }
.tcv-post-avatar { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #eff3f4; color: #8e8e8e; padding: 9px; box-sizing: border-box; }
.tcv-post-avatar svg { width: 100%; height: 100%; }
.tcv-post-main { min-width: 0; flex: 1 1 auto; }
.tcv-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-bottom: 4px; }
.tcv-post-name { font-size: 0.95rem; font-weight: 700; color: #0f1419; }
.tcv-post-handle { font-size: 0.85rem; color: #536471; }
.tcv-post-text { font-size: 0.95rem; color: #0f1419; margin-bottom: 10px; }
.tcv-card { min-width: 0; }
/* Large image card: 2:1 media, the title overlaid at the bottom left. */
.tcv-card-large { border-radius: 16px; overflow: hidden; border: 1px solid #cfd9de; }
.tcv-card-media { position: relative; aspect-ratio: 2 / 1; background: #eff3f4; overflow: hidden; }
.tcv-card-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tcv-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #8e8e8e; font-size: 0.85rem; }
.tcv-card-overlay {
    position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
    padding: 3px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.77); color: #fff;
    font-size: 0.82rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tcv-card-play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(29, 155, 240, 0.92); }
.tcv-card-play::after { content: ''; position: absolute; left: 22px; top: 17px; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.tcv-card-from { padding: 6px 2px 0; font-size: 0.85rem; color: #536471; }
/* Summary card: square thumbnail left, text right. */
.tcv-card-summary { display: flex; border: 1px solid #cfd9de; border-radius: 16px; overflow: hidden; }
.tcv-card-thumb { flex: 0 0 128px; width: 128px; aspect-ratio: 1 / 1; background: #eff3f4; border-right: 1px solid #cfd9de; overflow: hidden; }
.tcv-card-body { min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.tcv-card-domain { font-size: 0.85rem; color: #536471; }
.tcv-card-title { font-size: 0.95rem; color: #0f1419; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcv-card-desc { font-size: 0.85rem; color: #536471; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Tables ---- */
.tcv-table-wrap { overflow-x: clip; }
.tcv-table .col-tcv-field { width: 26%; }
.tcv-table .col-tcv-value { width: 52%; }
.tcv-table .col-tcv-source { width: 22%; }
.tcv-table td { vertical-align: top; font-size: 0.86rem; }
.tcv-field { font-weight: 600; color: #1f2937; }
.tcv-value { word-break: break-word; overflow-wrap: anywhere; }
.tcv-value a { color: var(--tcv-accent-dark); word-break: break-all; }
.tcv-source { color: #64748b; white-space: nowrap; }
.tcv-table code { font-size: 0.82em; background: #f5f6f8; padding: 1px 4px; border-radius: 4px; }

@media (max-width: 640px) {
    .tcv-report { padding: 12px 12px 14px; }
    .tcv-row { grid-template-columns: 70px minmax(0, 1fr); }
    .tcv-table .col-tcv-field { width: 34%; }
    .tcv-table .col-tcv-value { width: 66%; }
    .tcv-table td { padding-left: 6px; padding-right: 6px; }
    .tcv-post { max-width: none; }
    .tcv-card-thumb { flex-basis: 96px; width: 96px; }
    .tcv-summary { gap: 6px; }
    .results-header-right { flex-wrap: wrap; }
}

#tcv-history .history-item-meta { white-space: normal; min-width: 0; flex: 0 1 auto; }
