/* Страница «Рейтинги компаний» */

/* Контейнер и шапка (переносим из dashboards.css, т.к. страница его не подключает) */
.dashboards-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0f1419 100%);
    color: #e5e7eb;
    font-family: 'Inter', sans-serif;
}

.dashboards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(26, 31, 46, 0.95);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.dashboards-header .header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f59e0b;
    margin: 0;
}

.header-subtitle {
    font-size: 1rem;
    color: #9ca3af;
    padding-left: 1rem;
    border-left: 1px solid rgba(245, 158, 11, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #f59e0b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-nav-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.header-nav-btn--back {
    padding: 0.5rem 0.9rem;
}

.ratings-main {
    padding: 20px 28px 60px;
    max-width: 1600px;
    margin: 0 auto;
}

.ratings-sector-badge {
    margin-left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Toolbar */
.ratings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.ratings-toolbar-left { display: flex; gap: 16px; flex-wrap: wrap; }
.ratings-toolbar-right { display: flex; gap: 10px; }
.ratings-field { display: flex; flex-direction: column; gap: 5px; }
.ratings-field label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 600;
}
.ratings-field--search { min-width: 240px; }
.ratings-select, .ratings-input {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.ratings-input { width: 100%; }
.ratings-select:focus, .ratings-input:focus { border-color: var(--accent-gold); }

/* Кастомный дропдаун выбора квартала (со стилизуемым скроллбаром) */
.rt-dropdown { position: relative; min-width: 150px; }
.rt-dropdown-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.rt-dropdown-toggle:hover { border-color: var(--border-medium); }
.rt-dropdown--open .rt-dropdown-toggle { border-color: var(--accent-gold); }
.rt-dropdown-value { font-family: 'Roboto Mono', monospace; }
.rt-dropdown-chevron { color: var(--text-muted); transition: transform .18s ease; flex-shrink: 0; }
.rt-dropdown--open .rt-dropdown-chevron { transform: rotate(180deg); }

.rt-dropdown-panel {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
    max-height: 260px; overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.rt-dropdown-option {
    padding: 8px 12px; border-radius: 6px;
    font-size: 13px; font-family: 'Roboto Mono', monospace;
    color: var(--text-secondary); cursor: pointer;
    transition: background .12s, color .12s;
}
.rt-dropdown-option:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.rt-dropdown-option--active {
    background: rgba(245, 158, 11, 0.14);
    color: var(--accent-gold);
    font-weight: 600;
}
/* Тематический скроллбар списка кварталов */
.rt-dropdown-panel::-webkit-scrollbar { width: 10px; }
.rt-dropdown-panel::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); border-radius: 8px; margin: 4px 0; }
.rt-dropdown-panel::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.rt-dropdown-panel::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.6); background-clip: content-box; }
.rt-dropdown-panel { scrollbar-width: thin; scrollbar-color: rgba(245, 158, 11, 0.45) rgba(255, 255, 255, 0.04); }

.ratings-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.ratings-btn:hover { background: var(--bg-card-hover); border-color: var(--accent-gold); }
.ratings-btn--ghost { background: transparent; }

/* Легенда грейдов */
.ratings-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rt-legend-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 8px; font-size: 12px;
    background: var(--bg-secondary); border: 1px solid var(--border-subtle);
}
.rt-legend-badge { font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.rt-legend-text { color: var(--text-secondary); }

.ratings-summary { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.rt-sum-item { font-size: 13px; color: var(--text-secondary); }
.rt-sum-item--custom { color: var(--accent-gold); font-weight: 600; }

/* Источник данных (МСФО · Московская Биржа) */
.ratings-datasource {
    display: flex; align-items: flex-start; gap: 14px;
    margin-bottom: 18px; padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid #3b5bdb;
    border-radius: 10px;
}
.ratings-datasource-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ratings-datasource-text { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.ratings-datasource-text strong { color: var(--text-primary); font-weight: 700; }
.ratings-datasource-method { color: var(--text-muted); }
.ratings-datasource-method strong { color: var(--text-secondary); }
.ratings-datasource-btn {
    flex-shrink: 0; align-self: flex-start;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 8px; cursor: pointer;
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
    color: #e6ebff; background: rgba(59, 91, 219, 0.16);
    border: 1px solid rgba(59, 91, 219, 0.5);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.ratings-datasource-btn:hover {
    background: rgba(59, 91, 219, 0.28); border-color: rgba(99, 130, 245, 0.8);
    transform: translateY(-1px);
}
.ratings-datasource-btn.is-open {
    background: rgba(59, 91, 219, 0.32); border-color: rgba(99, 130, 245, 0.9);
    color: #fff;
}
.ratings-datasource-btn svg { flex-shrink: 0; }
@media (max-width: 720px) {
    .ratings-datasource { flex-direction: column; align-items: stretch; gap: 10px; }
    .ratings-datasource-btn { align-self: flex-start; }
}

.ratings-status { color: var(--text-secondary); font-size: 14px; padding: 12px 0; }

/* Индикатор расчёта: подсвеченное сообщение + анимация */
.ratings-status.rt-status--loading { padding: 20px 0; display: flex; justify-content: center; }
.rt-loader {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.12) 100%);
    border: 1px solid rgba(14, 165, 233, 0.35);
    box-shadow: 0 0 0 rgba(14, 165, 233, 0.35);
    animation: rt-loader-in .35s ease both, rt-loader-glow 1.8s ease-in-out infinite;
}
.rt-loader-spinner {
    width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
    border: 2.5px solid rgba(148, 163, 184, 0.25);
    border-top-color: var(--accent-emerald);
    border-right-color: var(--accent-cyan, #0ea5e9);
    animation: rt-spin .7s linear infinite;
}
.rt-loader-text {
    font-size: 15px; font-weight: 700; letter-spacing: .01em;
    background: linear-gradient(90deg, #34d399, #38bdf8, #34d399);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: rt-loader-shine 2.2s linear infinite;
}
.rt-loader-dots { display: inline-block; }
.rt-loader-dots i {
    font-style: normal; opacity: .2; animation: rt-loader-dot 1.4s infinite;
}
.rt-loader-dots i:nth-child(2) { animation-delay: .2s; }
.rt-loader-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes rt-spin { to { transform: rotate(360deg); } }
@keyframes rt-loader-in {
    from { opacity: 0; transform: translateY(6px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rt-loader-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(14, 165, 233, 0); }
    50% { box-shadow: 0 6px 26px rgba(14, 165, 233, 0.28); }
}
@keyframes rt-loader-shine {
    0% { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}
@keyframes rt-loader-dot {
    0%, 100% { opacity: .2; }
    40% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .rt-loader, .rt-loader-spinner, .rt-loader-text, .rt-loader-dots i {
        animation-duration: 0.001s; animation-iteration-count: 1;
    }
    .rt-loader-spinner { border-top-color: var(--accent-emerald); }
}

/* Таблица */
.ratings-table-wrap { overflow-x: auto; border-radius: 12px; }
.ratings-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: var(--bg-secondary);
}
.rt-th {
    position: sticky; top: 0; z-index: 2;
    background: var(--bg-card);
    color: var(--text-secondary);
    text-align: center;
    padding: 10px 8px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
    font-weight: 700;
    cursor: pointer; user-select: none;
    border-bottom: 1px solid var(--border-medium);
    white-space: nowrap;
}
.rt-th:hover { color: var(--text-primary); }
.rt-th--name { text-align: left; }
.rt-th--block { color: var(--text-muted); font-weight: 600; }
.rt-sort { margin-left: 3px; color: var(--accent-gold); }

.rt-row { border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background .12s; }
.rt-row--even { background: rgba(255, 255, 255, 0.018); }
.rt-row:hover { background: var(--bg-card); }
.rt-td {
    padding: 10px 10px; text-align: center; vertical-align: middle;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
.rt-td--name { text-align: left; }
/* Разделители групп колонок: перед каждым баллом рейтинга и перед рангом */
.rt-td--rating, .rt-th--rating { border-left: 1px solid var(--border-subtle); }
/* Колонка ранга — выделяем фоном и границами, чтобы читалась как отдельный акцент */
.rt-td--rank, .rt-th--rank {
    border-left: 1px solid var(--border-medium);
    background: rgba(245, 158, 11, 0.06);
}
.rt-th--rank { background: rgba(245, 158, 11, 0.12); color: var(--accent-gold); }
.rt-row:hover .rt-td--rank { background: rgba(245, 158, 11, 0.1); }
.rt-td--block .rt-block-score {
    font-family: 'Roboto Mono', monospace; color: var(--text-secondary);
    font-variant-numeric: tabular-nums; display: inline-block; min-width: 22px; text-align: center;
}
.rt-muted { color: var(--text-muted) !important; opacity: .5; }

.rt-name { display: flex; align-items: center; gap: 8px; }
.rt-caret { color: var(--accent-gold); font-size: 11px; width: 12px; flex-shrink: 0; }
.rt-name-text { font-weight: 500; color: var(--text-primary); }
.rt-flag {
    font-size: 10px; padding: 1px 6px; border-radius: 5px;
    background: rgba(245, 158, 11, 0.15); color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.35); cursor: help; white-space: nowrap;
}
.rt-stale {
    font-size: 10px; padding: 1px 6px; border-radius: 5px;
    background: rgba(148, 163, 184, 0.14); color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.4); cursor: help; white-space: nowrap;
    font-family: 'Roboto Mono', monospace;
}

/* Ячейка рейтинга: фиксированная сетка балл | грейд | дельта — колонки
   выравниваются по вертикали во всех строках */
.rt-rating {
    display: grid;
    grid-template-columns: 50px 30px 58px;
    align-items: center;
    gap: 8px;
    width: max-content;
    margin: 0 auto;
}
.rt-score {
    font-family: 'Roboto Mono', monospace; font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 3px 0; border-radius: 6px; width: 100%; text-align: center; display: inline-block;
}
.rt-grade { font-weight: 700; font-size: 12px; padding: 2px 0; border-radius: 5px; width: 100%; text-align: center; }
.rt-delta {
    font-size: 11px; font-family: 'Roboto Mono', monospace; font-variant-numeric: tabular-nums;
    justify-self: start; white-space: nowrap;
}
.rt-delta-up { color: var(--accent-emerald); }
.rt-delta-down { color: var(--accent-coral); }
.rt-delta-flat { color: var(--text-muted); }
.rt-rank { font-family: 'Roboto Mono', monospace; color: var(--text-secondary); font-weight: 600; }
.rt-rank-cell { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.rt-rank--top { color: var(--text-primary); font-weight: 700; }
.rt-rank-star { font-size: 13px; line-height: 1; }
.rt-rank-star--1 { color: #fbbf24; text-shadow: 0 0 8px rgba(251, 191, 36, 0.55); }
.rt-rank-star--2 { color: #cbd5e1; text-shadow: 0 0 6px rgba(203, 213, 225, 0.45); }
.rt-rank-star--3 { color: #d8894e; text-shadow: 0 0 6px rgba(216, 137, 78, 0.45); }

/* Значок «i» в заголовке столбца + стилизованный тултип */
.rt-th-label { vertical-align: middle; }
.rt-th-info {
    display: inline-flex; align-items: center; justify-content: center;
    width: 13px; height: 13px; margin-left: 5px; border-radius: 50%;
    font-size: 9px; font-weight: 700; font-style: italic;
    background: var(--border-medium); color: var(--text-secondary);
    vertical-align: middle; text-transform: none;
}
.rt-th:hover .rt-th-info { background: var(--accent-gold); color: #1a1205; }
.rt-tooltip {
    position: fixed; z-index: 1000; max-width: 320px;
    padding: 9px 12px; border-radius: 8px;
    background: var(--bg-card, #1b2233); color: var(--text-primary);
    border: 1px solid var(--border-medium);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-size: 12px; line-height: 1.45; font-weight: 400;
    text-transform: none; letter-spacing: normal; text-align: left;
    pointer-events: none; white-space: normal;
}
.rt-tooltip::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: var(--border-medium);
    top: 100%;
}
.rt-tooltip.rt-tooltip--below::after {
    top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--border-medium);
}

/* Цвета грейдов */
.grade-aplus { background: rgba(16, 185, 129, 0.22); color: #34d399; }
.grade-a { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.grade-bplus { background: rgba(245, 158, 11, 0.20); color: #fbbf24; }
.grade-b { background: rgba(245, 158, 11, 0.13); color: #fcd34d; }
.grade-cplus { background: rgba(239, 68, 68, 0.16); color: #f87171; }
.grade-c { background: rgba(239, 68, 68, 0.24); color: #fca5a5; }
.grade-na { background: var(--bg-card); color: var(--text-muted); }

/* Детализация */
.rt-detail-row { background: var(--bg-primary); }
.rt-detail-cell { padding: 0; }
.rt-detail { padding: 16px 20px; }
.rt-detail-loading, .rt-detail-error { color: var(--text-secondary); font-size: 13px; }
.rt-detail-error { color: var(--accent-coral); }
.rt-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.rt-detail-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px; }
.rt-detail-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rt-detail-title { font-weight: 600; color: var(--text-primary); flex: 1; }

.rt-block { margin-bottom: 12px; }
.rt-block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--border-subtle); }
.rt-block-name { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.rt-block-meta { font-size: 11px; color: var(--text-muted); }

.rt-metric { display: grid; grid-template-columns: 1fr auto 90px; gap: 10px; align-items: center; padding: 5px 0; }
.rt-metric--na { opacity: .5; }
.rt-metric-info { display: flex; flex-direction: column; }
.rt-metric-name { font-size: 12px; color: var(--text-primary); }
.rt-metric-sub { font-size: 11px; color: var(--text-muted); }
.rt-metric-vals { display: flex; gap: 10px; }
.rt-metric-stat { display: flex; flex-direction: column; align-items: flex-end; }
.rt-metric-stat-label { font-size: 9px; text-transform: uppercase; color: var(--text-muted); }
.rt-metric-stat-value { font-size: 12px; font-family: 'Roboto Mono', monospace; color: var(--text-secondary); }
.rt-spark { width: 90px; height: 30px; }
.rt-spark canvas { width: 90px !important; height: 30px !important; }

/* Поквартальная динамика рейтингов */
.rt-history { margin-bottom: 18px; }
.rt-history-title {
    font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 700; margin-bottom: 10px;
}
.rt-history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.rt-history-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px;
}
.rt-history-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rt-history-name { font-weight: 600; color: var(--text-primary); flex: 1; font-size: 13px; }
.rt-history-canvas { position: relative; height: 150px; width: 100%; }

/* AI-комментарий по рейтингу */
.rt-ai {
    margin-top: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px 16px;
}
.rt-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rt-ai-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-primary); font-size: 14px; }
.rt-ai-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px;
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    color: #fff; font-size: 13px;
}
.rt-ai-btn {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    color: #fff; border: none; cursor: pointer;
    padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 13px;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28);
}
.rt-ai-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14, 165, 233, 0.4); }
.rt-ai-btn:disabled { cursor: default; opacity: .7; transform: none; box-shadow: none; }
.rt-ai-btn--loading { position: relative; }
.rt-ai-body { margin-top: 12px; border-top: 1px dashed var(--border-subtle); padding-top: 12px; }
.rt-ai-loading { color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.rt-ai-loading::before {
    content: ''; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--border-medium); border-top-color: var(--accent-emerald);
    animation: rt-ai-spin .8s linear infinite;
}
@keyframes rt-ai-spin { to { transform: rotate(360deg); } }
.rt-ai-error { color: var(--accent-coral); font-size: 13px; }
.rt-ai-text { color: var(--text-secondary); font-size: 13.5px; line-height: 1.65; }
.rt-ai-text p { margin: 0 0 10px; }
.rt-ai-text p:last-child { margin-bottom: 0; }
.rt-ai-text strong {
    color: var(--text-primary); font-weight: 700;
    background: rgba(16, 185, 129, 0.14);
    padding: 0 4px; border-radius: 4px;
}
.rt-ai-text code {
    font-family: 'Roboto Mono', monospace; font-size: 12px;
    background: var(--bg-card); color: var(--accent-gold);
    padding: 1px 5px; border-radius: 4px;
}
/* Заголовки разделов AI-комментария */
.rt-ai-h1, .rt-ai-h2, .rt-ai-h3 { color: var(--text-primary); font-weight: 700; line-height: 1.3; }
.rt-ai-h1 {
    font-size: 15px; margin: 18px 0 10px;
    padding: 6px 12px; border-radius: 8px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(14, 165, 233, 0.16) 100%);
    border-left: 3px solid var(--accent-emerald);
}
.rt-ai-h2 {
    font-size: 14px; margin: 14px 0 8px; padding-left: 10px;
    border-left: 3px solid var(--accent-gold);
}
.rt-ai-h3 { font-size: 13px; margin: 12px 0 6px; color: var(--accent-gold); }
/* Отметки секций: «Сильные стороны» — зелёная, «Слабые стороны» — красная */
.rt-ai-pos, .rt-ai-neg { display: inline-flex; align-items: center; gap: 7px; }
.rt-ai-h3.rt-ai-pos { color: var(--accent-emerald); }
.rt-ai-h3.rt-ai-neg { color: var(--accent-coral); }
.rt-ai-pos::before, .rt-ai-neg::before {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    font-size: 10px; font-weight: 700; line-height: 1;
}
.rt-ai-pos::before { content: '✓'; color: #052e1c; background: var(--accent-emerald); }
.rt-ai-neg::before { content: '✕'; color: #2e0505; background: var(--accent-coral); }
/* Если пришло списком — заменяем маркер ▸ на цветную отметку */
.rt-ai-list li.rt-ai-pos::before,
.rt-ai-list li.rt-ai-neg::before {
    position: static; top: auto; left: auto; margin-right: 7px;
}
.rt-ai-text > :first-child { margin-top: 0; }
.rt-ai-list { margin: 4px 0 12px; padding-left: 4px; list-style: none; }
.rt-ai-list li {
    position: relative; padding: 3px 0 3px 18px; margin-bottom: 2px;
}
.rt-ai-list li::before {
    content: '▸'; position: absolute; left: 2px; top: 3px;
    color: var(--accent-emerald); font-size: 11px;
}
.rt-ai-meta { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border-subtle); font-size: 11px; color: var(--text-muted); font-style: italic; }
@media (prefers-reduced-motion: reduce) { .rt-ai-loading::before { animation: none; } }

/* Настройки весов */
.ratings-settings, .ratings-methodology {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.ratings-settings-header h3, .ratings-methodology-header h3 { margin: 0 0 4px; font-size: 16px; color: var(--text-primary); }
.ratings-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }
.ratings-settings-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.rt-settings-group-title { font-weight: 600; color: var(--accent-gold); margin-bottom: 8px; font-size: 13px; }
.rt-slider-row { display: grid; grid-template-columns: 1fr 120px 44px; align-items: center; gap: 10px; margin-bottom: 6px; }
.rt-slider-label { font-size: 12px; color: var(--text-secondary); }
.rt-slider { width: 100%; accent-color: var(--accent-gold); }
.rt-slider-value { font-family: 'Roboto Mono', monospace; font-size: 12px; color: var(--text-primary); text-align: right; }
.ratings-settings-footer { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.rt-custom-flag { font-size: 12px; color: var(--accent-gold); }

/* Методика */
.ratings-methodology-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.rt-mth-desc { font-size: 13px; color: var(--text-secondary); }
.rt-mth-features ul { margin: 4px 0 14px; padding-left: 20px; }
.rt-mth-features li { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.rt-mth-rating { margin-top: 16px; }
.rt-mth-rating h4 { margin: 0 0 6px; color: var(--text-primary); font-size: 14px; }
.rt-mth-block { margin: 10px 0; }
.rt-mth-block-title { font-weight: 600; color: var(--accent-gold); font-size: 13px; margin-bottom: 6px; }
.rt-mth-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.rt-mth-table th, .rt-mth-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.rt-mth-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 10px; }
.rt-mth-table td { color: var(--text-secondary); }
.rt-mth-table code { color: var(--accent-emerald); font-family: 'Roboto Mono', monospace; }

/* Таблица метрик методики: фиксированные ширины — колонки выровнены во всех блоках */
.rt-mth-metrics { table-layout: fixed; }
.rt-mth-metrics th:nth-child(1), .rt-mth-metrics td:nth-child(1) { width: 52px; }
.rt-mth-metrics th:nth-child(2), .rt-mth-metrics td:nth-child(2) { width: 26%; }
.rt-mth-metrics th:nth-child(3), .rt-mth-metrics td:nth-child(3) { width: 84px; }
.rt-mth-metrics th:nth-child(4), .rt-mth-metrics td:nth-child(4) { width: 56px; text-align: center; }
.rt-mth-metrics th:nth-child(5), .rt-mth-metrics td:nth-child(5) { width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.rt-mth-metrics th:nth-child(6), .rt-mth-metrics td:nth-child(6) { width: auto; }
.rt-mth-metrics .rt-mth-expr code { white-space: normal; word-break: break-word; line-height: 1.35; }
.rt-mth-grades { margin-top: 16px; }
.rt-mth-grades h4 { margin: 0 0 6px; color: var(--text-primary); font-size: 14px; }

@media (max-width: 900px) {
    .rt-metric { grid-template-columns: 1fr auto; }
    .rt-spark { display: none; }
}
