/* Dynamic tool comparison — /compare/ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cmp-page {
    max-width: 1180px;
    width: 100%;
    min-width: 0; /* body is a flex container; allow shrinking below the table's min-content */
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.cmp-breadcrumb {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.cmp-breadcrumb a {
    color: #4b5563;
    text-decoration: none;
}

.cmp-breadcrumb a:hover {
    color: #111827;
    text-decoration: underline;
}

.cmp-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.cmp-hero .cmp-tagline {
    font-size: 1.05rem;
    color: #4b5563;
    margin: 0 0 20px;
    max-width: 720px;
}

/* Tool picker */
.cmp-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.cmp-picker .cmp-vs {
    font-weight: 700;
    color: #9ca3af;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cmp-slot {
    position: relative;
    flex: 1 1 240px;
    max-width: 340px;
    min-width: 200px;
}

.cmp-slot input {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 8px 40px 8px 40px;
    font-size: 16px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    outline: 0;
}

.cmp-slot input:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
}

.cmp-slot input[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.cmp-slot .cmp-slot-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 15px;
    pointer-events: none;
}

.cmp-slot .cmp-slot-remove {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
}

.cmp-slot .cmp-slot-remove:hover {
    background: #f3f4f6;
    color: #111827;
}

.cmp-slot.filled .cmp-slot-remove {
    display: flex;
}

.cmp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 4px 0 24px;
}

.cmp-btn {
    height: 40px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #374151;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    cursor: pointer;
}

.cmp-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cmp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cmp-btn-primary {
    color: #fff;
    background: #1f2937;
    border-color: #1f2937;
}

.cmp-btn-primary:hover {
    color: #fff;
    background: #374151;
}

.cmp-hint {
    font-size: 13px;
    color: #6b7280;
}

/* Empty state suggestions */
.cmp-empty {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 24px;
}

.cmp-empty h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.cmp-empty p {
    color: #4b5563;
    margin: 0 0 16px;
    font-size: 15px;
}

.cmp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cmp-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.cmp-chip:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
    text-decoration: none;
}

.cmp-chip .cmp-chip-vs {
    color: #9ca3af;
    font-weight: 500;
}

/* Comparison table */
.cmp-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cmp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.cmp-table th,
.cmp-table td {
    text-align: left;
    vertical-align: top;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.cmp-table tr:last-child th,
.cmp-table tr:last-child td {
    border-bottom: 0;
}

.cmp-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
}

.cmp-table .cmp-rowlabel {
    width: 150px;
    min-width: 150px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #fafbfc;
    position: sticky;
    left: 0;
    z-index: 2;
}

.cmp-table thead .cmp-rowlabel {
    z-index: 3;
}

.cmp-toolhead {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.cmp-toolhead .cmp-toolname {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.cmp-toolhead .cmp-toolname:hover {
    text-decoration: underline;
}

.cmp-toolhead .cmp-toolname-external {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.cmp-avatar {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 19px;
    font-weight: 700;
    color: #374151;
    overflow: hidden;
    flex-shrink: 0;
}

.cmp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cmp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cmp-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.cmp-badge.free { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.cmp-badge.freemium { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.cmp-badge.paid { color: #1f2937; background: #f3f4f6; border-color: #e5e7eb; }
.cmp-badge.unknown { color: #6b7280; background: #f9fafb; border-color: #e5e7eb; }
.cmp-badge.live { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.cmp-badge.discontinued { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.cmp-badge.rank { color: #111827; background: #fff; border-color: #e5e7eb; }

.cmp-cell-text {
    font-size: 14.5px;
    color: #374151;
    line-height: 1.55;
}

.cmp-cell-text.cmp-catch {
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #ffe4e6;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
}

.cmp-cell-list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: #374151;
    line-height: 1.55;
}

.cmp-cell-list li {
    margin-bottom: 4px;
}

.cmp-cell-list.cmp-pros li::marker { color: #059669; }
.cmp-cell-list.cmp-cons li::marker { color: #e11d48; }

.cmp-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cmp-link {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cmp-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    text-decoration: none;
}

.cmp-note {
    font-size: 12.5px;
    color: #6b7280;
    margin-top: 12px;
}

@media (max-width: 640px) {
    .cmp-page { padding: 16px 10px 48px; }
    .cmp-hero h1 { font-size: 1.5rem; }
    .cmp-slot { flex: 1 1 100%; max-width: none; }
    .cmp-picker .cmp-vs { display: none; }
    .cmp-table .cmp-rowlabel { width: 108px; min-width: 108px; font-size: 11px; }
}
