/* NeRating — nb-nerating-*, nb-complaint-*
   Bridge: site.css tokens → affpapa.min.css tokens */
.nb-nerating-page {
    --text: var(--ink, #e8ece8);
    --text-2: var(--ink-2, #9ba69d);
    --text-3: var(--muted, #7d877d);
    --font-ui: var(--sans, 'Golos Text', system-ui, sans-serif);
    --font-data: var(--mono, 'JetBrains Mono', monospace);
    --danger: var(--accent, #e63946);
    --danger-dim: rgba(230, 57, 70, 0.15);
    --warn: #e6a817;
    --warn-dim: rgba(230, 168, 23, 0.15);
    --t-hover: 150ms;
    --t-press: 100ms;
    --t-enter: 200ms;
}

/* --- Page layout --- */
.nb-nerating-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.nb-nerating-header {
    margin-bottom: 2rem;
}

.nb-nerating-title {
    font-family: var(--font-ui);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0.5rem 0 0.25rem;
    color: var(--text);
}

.nb-nerating-subtitle {
    font-family: var(--font-ui);
    color: var(--text-2);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.nb-nerating-section-title {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    font-weight: 640;
    color: var(--text);
    margin: 2rem 0 1rem;
}

/* --- Stats row --- */
.nb-nerating-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.nb-nerating-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.nb-nerating-stat-value {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}

.nb-nerating-stat-value--money {
    color: var(--money);
}

.nb-nerating-stat-label {
    font-size: 0.8125rem;
    color: var(--text-3);
}

/* --- Filters --- */
.nb-nerating-filters {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0 1.25rem;
    flex-wrap: wrap;
}

.nb-nerating-search {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    flex: 1;
    min-width: 180px;
    max-width: 320px;
    transition: border-color var(--t-hover) var(--ease-out);
}

.nb-nerating-search::placeholder {
    color: var(--text-3);
}

.nb-nerating-search:focus {
    outline: none;
    border-color: var(--text-2);
}

.nb-nerating-select {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--t-hover) var(--ease-out);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ba69d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.nb-nerating-select:focus {
    outline: none;
    border-color: var(--text-2);
}

.nb-nerating-select:active {
    transform: scale(0.97);
}

/* --- Table --- */
.nb-nerating-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nb-nerating-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 0.9375rem;
}

.nb-nerating-th {
    text-align: left;
    font-weight: 500;
    color: var(--text-3);
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.nb-nerating-th--num {
    text-align: right;
}

.nb-nerating-row {
    border-bottom: 1px solid var(--line);
    transition: background-color var(--t-hover) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .nb-nerating-row:hover {
        background: var(--surface);
    }
}

.nb-nerating-row:active {
    transform: scale(0.997);
}

.nb-nerating-td {
    padding: 0.75rem;
    vertical-align: middle;
    color: var(--text);
}

.nb-nerating-td--num {
    text-align: right;
    white-space: nowrap;
}

.nb-nerating-td--brand {
    font-weight: 500;
}

.nb-nerating-brand-link {
    color: var(--text);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .nb-nerating-brand-link:hover {
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

/* --- Money color --- */
.nb-nerating-money {
    color: var(--money);
}

/* --- Risk index colors --- */
.nb-nerating-risk--high {
    color: var(--danger);
}

.nb-nerating-risk--medium {
    color: var(--warn);
}

.nb-nerating-risk--low {
    color: var(--text);
}

/* --- Brand header --- */
.nb-nerating-brand-header {
    margin-bottom: 2rem;
}

/* --- Analytics: status bar --- */
.nb-nerating-analytics {
    margin: 1.5rem 0 0.5rem;
}

.nb-nerating-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
}

.nb-nerating-bar-seg {
    border-radius: 2px;
    min-width: 4px;
    transition: width 300ms var(--ease-out);
}

.nb-nerating-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text);
}

.nb-nerating-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nb-nerating-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Analytics: sources --- */
.nb-nerating-source-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nb-nerating-source-chip {
    font-size: 0.8125rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface);
}

/* --- Analytics: trend bars --- */
.nb-nerating-trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 64px;
}

.nb-nerating-trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nb-nerating-trend-bar {
    width: 100%;
    min-height: 2px;
    background: var(--danger);
    border-radius: 2px 2px 0 0;
    opacity: 0.75;
}

.nb-nerating-trend-label {
    font-size: 0.625rem;
    font-family: var(--font-data);
    color: var(--text-3);
}

/* --- Empty state --- */
.nb-nerating-empty {
    text-align: center;
    color: var(--text-3);
    padding: 2rem;
}

/* --- Pagination --- */
.nb-nerating-pagination,
.nb-complaint-pagination {
    margin-top: 1.5rem;
}

.nb-pager {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0;
}

.nb-pager-btn {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    transition: border-color var(--t-hover) var(--ease-out);
}

.nb-pager-btn:active {
    transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
    .nb-pager-btn:hover {
        border-color: var(--text-2);
    }
}

.nb-pager-btn--disabled {
    color: var(--text-3);
    cursor: not-allowed;
    opacity: 0.5;
}

.nb-pager-info {
    font-size: 0.8125rem;
    color: var(--text-3);
}

/* ========================================
   Complaints Feed
   ======================================== */

.nb-complaint-feed {
    margin-top: 0.5rem;
}

/* --- Row --- */
.nb-complaint-row {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.nb-complaint-row:first-child {
    border-top: 1px solid var(--line);
}

/* --- Meta line --- */
.nb-complaint-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.375rem;
}

.nb-complaint-date {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    color: var(--text-3);
}

.nb-complaint-source {
    font-size: 0.8125rem;
    color: var(--text-3);
}

/* --- Title --- */
.nb-complaint-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* --- Category badges --- */
.nb-complaint-category {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.nb-complaint-category--payment_hold,
.nb-complaint-category--account_ban,
.nb-complaint-category--bonus_scam,
.nb-complaint-category--rigged {
    background: var(--danger-dim);
    color: var(--danger);
}

.nb-complaint-category--kyc_rejection {
    background: var(--warn-dim);
    color: var(--warn);
}

.nb-complaint-category--license_revoked,
.nb-complaint-category--other {
    background: rgba(155, 166, 157, 0.12);
    color: var(--text-2);
}

/* --- Resolution badges --- */
.nb-complaint-resolution {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    color: var(--text-2);
}

.nb-complaint-resolution::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nb-complaint-resolution--open::before {
    background: var(--danger);
}

.nb-complaint-resolution--resolved::before {
    background: var(--money);
}

.nb-complaint-resolution--pending::before {
    background: var(--warn);
}

/* --- Body with collapse --- */
.nb-complaint-body {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text);
    overflow-wrap: break-word;
}

.nb-complaint-body--collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Toggle button --- */
.nb-complaint-toggle {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-3);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: color var(--t-hover) var(--ease-out);
}

.nb-complaint-toggle:active {
    transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
    .nb-complaint-toggle:hover {
        color: var(--text);
    }
}

/* --- Footer --- */
.nb-complaint-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.nb-complaint-amount {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--warn);
}

.nb-complaint-source-link {
    font-size: 0.75rem;
    color: var(--text-3);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .nb-complaint-source-link:hover {
        color: var(--text-2);
    }
}

/* --- Empty state --- */
.nb-complaint-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-3);
    font-size: 0.9375rem;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .nb-nerating-row,
    .nb-nerating-select,
    .nb-nerating-search,
    .nb-complaint-toggle {
        transition: none;
    }

    .nb-nerating-row:active,
    .nb-nerating-select:active,
    .nb-complaint-toggle:active {
        transform: none;
    }
}

/* --- Mobile --- */
@media (max-width: 640px) {
    .nb-nerating-page {
        padding: 1.25rem 0.75rem;
    }

    .nb-nerating-title {
        font-size: 1.375rem;
    }

    .nb-nerating-stats {
        gap: 1.25rem;
    }

    .nb-nerating-stat-value {
        font-size: 1.25rem;
    }

    .nb-nerating-th,
    .nb-nerating-td {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }

    .nb-nerating-filters {
        flex-direction: column;
    }

    .nb-nerating-search {
        max-width: none;
    }
}
