/* См. оригинал в www/css/style.css — этот файл является копией для корня проекта. */
/* Теннис — прогнозы. Тёмная тема по умолчанию (тёмно-зелёный корт) */
:root {
    --bg-page: #1a2f1a;
    --bg-card: #243d24;
    --bg-header: #1e361e;
    --text-primary: #e8f0e8;
    --text-secondary: #b8c8b8;
    --accent: #7cb342;
    --accent-dim: #5d8a2e;
    --divider: #3d5c3d;
    --correct: #81c784;
    --incorrect: #e57373;
    --interrupted: #ffb74d;
    --pending: #90a4ae;
    --prediction-winner: #ffd54f;
}

/* Светлая тема (белый/кремовый фон) */
body.theme-light {
    --bg-page: #f5f5f0;
    --bg-card: #ffffff;
    --bg-header: #e8ebe0;
    --text-primary: #1a241a;
    --text-secondary: #4a5c4a;
    --accent: #558b2f;
    --accent-dim: #33691e;
    --divider: #c5d0c5;
    --correct: #2e7d32;
    --incorrect: #c62828;
    --interrupted: #ef6c00;
    --pending: #546e7a;
    --prediction-winner: #f9a825;
}

body.theme-light .icon-home,
body.theme-light .icon-settings,
body.theme-light .icon-history {
    filter: brightness(0);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============ ШАПКА ============ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #0f2410 0%, #1e361e 50%, #2a4a2a 100%);
    border-bottom: 1px solid rgba(124, 179, 66, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: saturate(140%) blur(6px);
    padding: 0;
}

.app-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 20%,
        #d4ed4f 50%,
        var(--accent) 80%,
        transparent 100%);
    opacity: 0.7;
    pointer-events: none;
}

body.theme-light .app-header {
    background: linear-gradient(135deg, #e8ebe0 0%, #f5f5f0 50%, #ffffff 100%);
    border-bottom-color: rgba(85, 139, 47, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.app-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.app-brand:hover {
    transform: translateY(-1px);
}

.app-brand__ball {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #e8f56b 0%, #c5dc3a 70%, #9bb528 100%);
    box-shadow:
        0 0 0 2px rgba(212, 237, 79, 0.25),
        0 4px 14px rgba(212, 237, 79, 0.4),
        inset -3px -3px 6px rgba(0, 0, 0, 0.15);
    animation: ball-pulse 2.4s ease-in-out infinite;
    flex-shrink: 0;
}

.app-brand__ball svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

@keyframes ball-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(212, 237, 79, 0.25),
            0 4px 14px rgba(212, 237, 79, 0.4),
            inset -3px -3px 6px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow:
            0 0 0 4px rgba(212, 237, 79, 0.15),
            0 4px 22px rgba(212, 237, 79, 0.65),
            inset -3px -3px 6px rgba(0, 0, 0, 0.15);
    }
}

.app-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.app-brand__title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}

body.theme-light .app-brand__title {
    color: #1a241a;
}

.app-brand__title-accent {
    background: linear-gradient(90deg, #d4ed4f, #7cb342);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 0.15em;
    font-weight: 800;
}

.app-brand__subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-top: 2px;
    opacity: 0.9;
}

.app-brand__live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    margin-left: 0.4rem;
    background: linear-gradient(135deg, #e53935, #c62828);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.45);
    text-transform: uppercase;
}

.app-brand__live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: live-blink 1.2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

@keyframes live-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Заголовок в админке (старая разметка) */
.app-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

.nav-link:hover {
    background: rgba(124, 179, 66, 0.12);
    color: var(--text-primary);
    border-color: rgba(124, 179, 66, 0.25);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    color: #fff;
    box-shadow: 0 2px 10px rgba(124, 179, 66, 0.35);
    border-color: transparent;
}

body.theme-light .nav-link.active {
    color: #fff;
}

.nav-link .icon {
    width: 1.05em;
    height: 1.05em;
}

@media (max-width: 640px) {
    .app-header__inner {
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
    }
    .app-brand__ball {
        width: 36px;
        height: 36px;
    }
    .app-brand__title {
        font-size: 1.1rem;
    }
    .app-brand__subtitle {
        font-size: 0.68rem;
    }
    .app-brand__live-badge {
        padding: 0.18rem 0.45rem;
        font-size: 0.62rem;
        margin-left: 0.25rem;
    }
    .nav-link {
        padding: 0.45rem 0.65rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 380px) {
    .app-brand__subtitle {
        display: none;
    }
}

.icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8f0e8'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.icon-settings {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8f0e8'%3E%3Cpath d='M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E");
}

.icon-history {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8f0e8'%3E%3Cpath d='M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z'/%3E%3C/svg%3E");
}

.main-content {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* История: на всю ширину окна — удобнее длинные таблицы геймов */
body.page-history .main-content {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

body.page-history .site-footer {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

/* Статический блок для SEO и первого экрана (не очищается JS) */
.index-seo-intro {
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    border: 1px solid var(--divider);
}

body.theme-light .index-seo-intro {
    background: rgba(0, 0, 0, 0.04);
}

.index-seo-intro__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
}

.index-seo-intro__text {
    margin: 0 0 0.65rem 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.index-seo-intro__text:last-child {
    margin-bottom: 0;
}

.index-seo-intro__text a {
    color: var(--accent);
}

.site-system-about {
    margin: 0 0 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 179, 66, 0.35);
    background: rgba(124, 179, 66, 0.08);
}

body.theme-light .site-system-about {
    background: rgba(85, 139, 47, 0.07);
    border-color: rgba(85, 139, 47, 0.35);
}

.site-system-about__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--accent);
}

.site-system-about__text {
    margin: 0 0 0.55rem 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-primary);
}

.site-system-about__text:last-child {
    margin-bottom: 0;
}

.site-target-events {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.65rem 0 0.5rem 0;
    padding: 0;
    list-style: none;
}

.site-target-events li {
    margin: 0;
    padding: 0.28rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 999px;
    border: 1px solid rgba(212, 237, 79, 0.45);
    background: rgba(212, 237, 79, 0.12);
    color: var(--text-primary);
}

.site-disclaimer--legal {
    border-left-color: var(--incorrect);
    background: rgba(229, 57, 53, 0.06);
}

body.theme-light .site-disclaimer--legal {
    background: rgba(198, 40, 40, 0.06);
}

.site-disclaimer--legal strong {
    color: var(--text-primary);
}

.site-footer-legal {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--divider);
}

.site-footer-legal p {
    margin: 0 0 0.5rem 0;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.site-footer-legal p:last-child {
    margin-bottom: 0;
}

.site-footer-legal ul {
    margin: 0.35rem 0 0.5rem 1.1rem;
    padding: 0;
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.site-legal-strip {
    margin: 0;
    padding: 0.45rem 1rem;
    font-size: 0.72rem;
    line-height: 1.4;
    text-align: center;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid var(--divider);
}

body.theme-light .site-legal-strip {
    background: rgba(0, 0, 0, 0.04);
}

.site-betting-note {
    margin: 0;
    padding: 0.4rem 1rem 0.5rem;
    font-size: 0.74rem;
    line-height: 1.45;
    text-align: center;
    color: var(--text-secondary);
    background: rgba(229, 115, 115, 0.08);
    border-bottom: 1px solid rgba(229, 115, 115, 0.2);
}

body.theme-light .site-betting-note {
    background: rgba(198, 40, 40, 0.06);
    border-bottom-color: rgba(198, 40, 40, 0.15);
}

.site-betting-note__scope {
    font-weight: 600;
    color: var(--text-primary);
}

.predictions-placeholder {
    margin: 0;
    padding: 0.75rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.noscript-msg {
    padding: 0.75rem 1rem;
    background: rgba(229, 57, 53, 0.12);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.history-loading-msg {
    margin: 0;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-cache-notice {
    margin: 0 0 0.75rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(212, 237, 79, 0.35);
    background: rgba(124, 179, 66, 0.12);
    color: var(--text-primary);
    font-size: 0.88rem;
}

.site-footer {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem 1.5rem;
    border-top: 1px solid var(--divider);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--accent-dim);
}

.site-disclaimer {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.site-disclaimer--intro {
    margin: 0 0 1rem 0;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid var(--divider);
    background: rgba(0, 0, 0, 0.04);
}

body:not(.theme-light) .site-disclaimer--intro {
    background: rgba(255, 255, 255, 0.04);
}

.index-top-line {
    margin: 0 0 1rem 0;
    border: none;
    border-top: 1px solid var(--divider);
}

.status-line {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    white-space: pre-line;
}

.history-pager {
    margin: 1.25rem 0 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(124, 179, 66, 0.22);
    background: linear-gradient(180deg, rgba(30, 54, 30, 0.55) 0%, rgba(15, 36, 16, 0.35) 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

body.theme-light .history-pager {
    border-color: rgba(85, 139, 47, 0.28);
    background: linear-gradient(180deg, #f8faf4 0%, #eef3e6 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.history-pager__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.history-pager__position {
    font-weight: 500;
    color: var(--text-primary);
}

.history-pager__position-num {
    color: var(--accent);
    font-weight: 800;
}

.history-pager__meta {
    opacity: 0.92;
}

.history-pager__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.history-pager__item {
    display: inline-flex;
}

.history-pager__btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.history-pager__btn--link {
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-light .history-pager__btn--link {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

.history-pager__btn--link:hover {
    background: rgba(124, 179, 66, 0.2);
    border-color: rgba(124, 179, 66, 0.45);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 179, 66, 0.25);
}

body.theme-light .history-pager__btn--link:hover {
    color: #1a241a;
}

.history-pager__btn--current {
    cursor: default;
    color: #1a241a;
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    border-color: rgba(212, 237, 79, 0.5);
    box-shadow: 0 0 0 2px rgba(124, 179, 66, 0.35), 0 3px 12px rgba(124, 179, 66, 0.35);
    font-weight: 800;
    min-width: 2.65rem;
}

.history-pager__btn--disabled {
    opacity: 0.4;
    cursor: default;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.history-pager__ellipsis {
    min-width: 1.75rem;
    padding: 0 0.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.08em;
    user-select: none;
}

/* Совместимость со старыми классами (SEO-срез) */
.history-pager-info {
    display: block;
    margin-bottom: 10px;
}

.history-pager-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-pager-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    border-radius: 10px;
}

.history-pager-btn--active,
.history-pager-btn--current {
    pointer-events: none;
}

.history-pager-btn--disabled {
    opacity: 0.55;
    cursor: default;
}

.filter-skip-reasons {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
    margin: -0.5rem 0 1rem 0;
    padding: 0.5rem 0.65rem;
    border-left: 3px solid var(--divider);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-light .filter-skip-reasons {
    background: rgba(0, 0, 0, 0.03);
}

.filter-skip-reasons[hidden] {
    display: none !important;
}

.filter-skip-reasons .filter-skip-head {
    margin: 0 0 0.45rem 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.filter-skip-reasons .filter-skip-sub {
    margin: 0 0 0.55rem 0;
    font-size: 0.8rem;
    line-height: 1.42;
    opacity: 0.92;
    color: var(--text-secondary);
}

.filter-skip-reasons .filter-skip-line {
    margin: 0 0 0.35rem 0;
}

.filter-skip-reasons .filter-skip-section-head {
    margin: 0.65rem 0 0.35rem 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.84rem;
}

.filter-skip-reasons .filter-skip-section-head:first-of-type {
    margin-top: 0.2rem;
}

.filter-skip-reasons .filter-skip-hint {
    margin: 0 0 0.5rem 0;
    font-size: 0.78rem;
    line-height: 1.4;
    opacity: 0.92;
}

.filter-skip-reasons .filter-skip-line--block {
    margin-left: 0.15rem;
    padding-left: 0.45rem;
    border-left: 2px solid var(--divider);
}

.filter-skip-reasons .filter-skip-line--reason {
    margin-left: 0.15rem;
    padding-left: 0.45rem;
    border-left: 2px solid var(--divider);
}

.filter-skip-reasons .filter-skip-count {
    display: inline-block;
    min-width: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 0.25rem;
}

.filter-skip-reasons .filter-skip-summary {
    margin: 0.55rem 0 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid var(--divider);
    font-size: 0.8rem;
    line-height: 1.42;
    color: var(--text-secondary);
}

.filter-skip-reasons .filter-skip-line:last-child {
    margin-bottom: 0;
}

.proxy-warning {
    color: #e65100;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: -0.25rem 0 0.75rem 0;
    padding: 0.55rem 0.7rem;
    border-left: 3px solid #e65100;
    background: rgba(230, 81, 0, 0.08);
    border-radius: 0 4px 4px 0;
}

body:not(.theme-light) .proxy-warning {
    background: rgba(230, 81, 0, 0.12);
}

.proxy-warning[data-proxy-replace="2"] {
    border-left-color: #c62828;
}

.proxy-warning[data-proxy-replace="1"] {
    border-left-color: #ef6c00;
}

.update-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: -0.5rem 0 1rem 0;
}

.history-book-sim {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-light .history-book-sim {
    background: rgba(0, 0, 0, 0.03);
}

.history-book-sim__heading {
    margin: 0 0 0.65rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
}

.history-book-sim__intro {
    margin-bottom: 0.5rem;
}

.history-book-sim__intro-rules {
    margin: 0 0 0.35rem 0;
    padding-left: 1.15rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.history-book-sim__intro-rules li {
    margin-bottom: 0.35rem;
}

.history-book-sim__results {
    padding-top: 0.65rem;
    border-top: 1px solid var(--divider);
}

.history-book-sim__placeholder {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
    font-style: italic;
}

.history-book-sim__scheme {
    margin: 0 0 0.85rem 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid var(--divider);
}

body.theme-light .history-book-sim__scheme {
    background: rgba(0, 0, 0, 0.04);
}

.history-book-sim__verdict {
    margin: 0 0 0.75rem 0;
    padding: 0.65rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.history-book-sim__verdict--good {
    background: rgba(76, 175, 80, 0.14);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.history-book-sim__verdict--bad {
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid rgba(229, 57, 53, 0.38);
}

.history-book-sim__verdict--neutral {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--divider);
}

body.theme-light .history-book-sim__verdict--neutral {
    background: rgba(0, 0, 0, 0.04);
}

.history-book-sim__figures {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.55rem 1rem;
    margin: 0 0 0.75rem 0;
}

.history-book-sim__figures > div,
.history-book-sim__figures-row {
    margin: 0;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--divider);
}

body.theme-light .history-book-sim__figures > div,
body.theme-light .history-book-sim__figures-row {
    background: rgba(0, 0, 0, 0.03);
}

.history-book-sim__figures-row--hits {
    border-color: rgba(129, 199, 132, 0.22);
}

.history-book-sim__figures-row--surface {
    border-color: rgba(100, 181, 246, 0.28);
}

.history-book-sim__surface-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: center;
}

.history-book-sim__surface-chip {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(144, 164, 174, 0.25);
    font-size: 0.88em;
    line-height: 1.35;
}

body.theme-light .history-book-sim__surface-chip {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.history-book-sim__surface-name {
    font-weight: 600;
    color: var(--text-primary);
}

.history-book-sim__surface-pct {
    font-weight: 700;
}

.history-book-sim__surface-pct--good {
    color: var(--correct);
}

.history-book-sim__surface-pct--bad {
    color: var(--incorrect);
}

.history-book-sim__surface-pct--mid {
    color: var(--text-primary);
}

.history-book-sim__surface-n {
    font-size: 0.92em;
    color: var(--text-secondary);
    opacity: 0.9;
}

.history-book-sim__figures-row--pl {
    border-color: rgba(124, 179, 66, 0.28);
}

.history-book-sim__figures-row--roi {
    border-color: rgba(144, 202, 249, 0.22);
}

.history-book-sim__figures dt {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
}

.history-book-sim__figures dd {
    margin: 0.2rem 0 0 0;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.history-book-sim__figures-val {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.history-book-sim__figures-val--count {
    color: #90caf9;
}

body.theme-light .history-book-sim__figures-val--count {
    color: #1565c0;
}

.history-book-sim__figures-val--win {
    color: var(--correct);
}

.history-book-sim__figures-val--loss {
    color: var(--incorrect);
}

.history-book-sim__figures-val--stake {
    color: #fff9c4;
}

body.theme-light .history-book-sim__figures-val--stake {
    color: #f57f17;
}

.history-book-sim__figures-val--pos {
    color: var(--correct);
}

.history-book-sim__figures-val--neg {
    color: var(--incorrect);
}

.history-book-sim__figures-val--zero {
    color: var(--text-secondary);
}

.history-book-sim__figures-sep {
    margin: 0 0.12rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.7;
}

.history-book-sim__figures-hint {
    font-weight: 600;
    font-size: 0.82em;
}

.history-book-sim__figures-hint--good {
    color: var(--correct);
}

.history-book-sim__figures-hint--bad {
    color: var(--incorrect);
}

.history-book-sim__figures-hint--mid {
    color: var(--text-secondary);
}

.history-book-sim__profit-big {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.history-book-sim__profit-big--pos {
    color: #81c784;
}

.history-book-sim__profit-big--neg {
    color: #e57373;
}

body.theme-light .history-book-sim__profit-big--pos {
    color: #2e7d32;
}

body.theme-light .history-book-sim__profit-big--neg {
    color: #c62828;
}

.history-book-sim__compare {
    margin: 0 0 1rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 179, 66, 0.35);
    background: rgba(124, 179, 66, 0.06);
}

.history-book-sim__compare-heading {
    margin: 0 0 0.45rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-book-sim__compare-lead {
    margin: 0 0 0.65rem 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.history-book-sim__compare-lead code {
    font-size: 0.78em;
}

.history-book-sim__compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.history-book-sim__compare-grid--single {
    grid-template-columns: 1fr;
}

@media (max-width: 720px) {
    .history-book-sim__compare-grid {
        grid-template-columns: 1fr;
    }
}

.history-book-sim__compare-col {
    padding: 0.5rem 0.55rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.12);
}

body.theme-light .history-book-sim__compare-col {
    background: rgba(0, 0, 0, 0.03);
}

.history-book-sim__compare-col-title {
    margin: 0 0 0.4rem 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.history-book-sim__compare-figures {
    margin: 0 0 0.35rem 0;
    font-size: 0.8rem;
}

.history-book-sim__compare-figures dt {
    color: var(--text-secondary);
    font-weight: 500;
}

.history-book-sim__compare-figures dd {
    margin: 0 0 0.35rem 0;
    font-weight: 600;
    line-height: 1.45;
}

.history-book-sim__compare-figures dd .history-book-sim__figures-hint {
    display: block;
    margin-top: 0.25rem;
    font-weight: 400;
    font-size: 0.72rem;
    line-height: 1.4;
}

.history-book-sim__compare-profit--pos {
    color: #81c784;
}

.history-book-sim__compare-profit--neg {
    color: #e57373;
}

body.theme-light .history-book-sim__compare-profit--pos {
    color: #2e7d32;
}

body.theme-light .history-book-sim__compare-profit--neg {
    color: #c62828;
}

.history-book-sim__compare-empty {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-book-sim__compare-details {
    margin-top: 0.35rem;
    font-size: 0.78rem;
}

.history-book-sim__compare-details summary {
    cursor: pointer;
    color: var(--text-secondary);
}

.history-book-sim__compare-details--win summary {
    color: var(--correct);
}

.history-book-sim__compare-details--loss summary {
    color: var(--incorrect);
}

.history-book-sim__compare-hits-correct {
    color: var(--correct);
}

.history-book-sim__compare-hits-incorrect {
    color: var(--incorrect);
}

.history-book-sim__compare-hits-legloss {
    color: var(--incorrect);
    font-weight: 600;
    opacity: 0.88;
}

.history-book-sim__dt-hint {
    font-size: 0.72em;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: help;
    white-space: nowrap;
}

.history-book-sim__figures-hint--strategy {
    display: inline-block;
    margin-left: 0.15rem;
}

/* Метки турнира и покрытия в шапке события истории */
.history-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.2rem 0 0.45rem;
}

.history-event-meta__badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.history-event-meta__badge--level {
    color: #e8f5e9;
    background: rgba(124, 179, 66, 0.22);
    border: 1px solid rgba(124, 179, 66, 0.45);
}

.history-event-meta__badge--surface {
    color: #fff9c4;
    background: rgba(255, 213, 79, 0.12);
    border: 1px solid rgba(255, 213, 79, 0.35);
}

body.theme-light .history-event-meta__badge--level {
    color: #33691e;
    background: rgba(85, 139, 47, 0.12);
    border-color: rgba(85, 139, 47, 0.35);
}

body.theme-light .history-event-meta__badge--surface {
    color: #6d4c00;
    background: rgba(249, 168, 37, 0.15);
    border-color: rgba(249, 168, 37, 0.4);
}

.history-book-sim__compare-list {
    margin: 0.35rem 0 0 0;
    padding-left: 1.1rem;
    list-style: none;
}

.history-book-sim__compare-item {
    margin-bottom: 0.45rem;
    line-height: 1.4;
}

.history-book-sim__compare-item--win .history-book-sim__compare-icon {
    color: #81c784;
}

.history-book-sim__compare-item--loss .history-book-sim__compare-icon {
    color: #e57373;
}

.history-book-sim__compare-meta {
    color: var(--text-secondary);
}

.history-book-sim__compare-rec {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.92;
}

.history-book-sim__pl-calc {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
    opacity: 0.95;
}

.history-book-sim__pl-calc-win {
    color: var(--text-primary);
}

.history-book-sim__pl-calc-leg {
    white-space: nowrap;
}

.history-book-sim__pl-calc-odd {
    font-weight: 600;
    color: var(--accent, #7cb342);
}

body.theme-light .history-book-sim__pl-calc-odd {
    color: #558b2f;
}

.history-book-sim__pl-calc-loss {
    font-weight: 600;
    color: var(--incorrect);
}

.history-book-sim__compare-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.history-book-sim__compare-note {
    margin: 0.55rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-book-sim__compare-list .game-score-hint {
    font-size: 0.85em;
}

.history-book-sim__compare-item--loss .game-score-side--bad {
    color: var(--incorrect);
    font-weight: 700;
}

.history-book-sim__compare-item--win .game-score-side--good {
    color: var(--correct);
    font-weight: 700;
}

.history-book-sim__compare-list .history-serve-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: middle;
    margin: 0 0.15em;
}

.history-book-sim__compare-list .history-book-sim__recv1540-players--guest-serves .serve-dot {
    margin-left: 0.2em;
}

.history-book-sim__target-group {
    margin: 0 0 0.85rem 0;
    padding: 0.4rem 0.45rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 179, 66, 0.45);
    background: rgba(124, 179, 66, 0.08);
}

body.theme-light .history-book-sim__target-group {
    border-color: rgba(85, 139, 47, 0.35);
    background: rgba(85, 139, 47, 0.06);
}

.history-book-sim__target-group .history-book-sim__list--target {
    margin: 0;
}

.history-book-sim__target-group .history-book-sim__list--target > li {
    margin-bottom: 0.4rem;
}

.history-book-sim__target-group .history-book-sim__list--target > li:last-child {
    margin-bottom: 0;
}

.history-book-sim__li--strategy-tz-sum {
    margin-top: 0.15rem;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border-left: 3px solid #7cb342;
    background: rgba(124, 179, 66, 0.14);
    list-style: none;
    border-top: 1px dashed rgba(124, 179, 66, 0.45);
}

body.theme-light .history-book-sim__li--strategy-tz-sum {
    background: rgba(85, 139, 47, 0.1);
    border-left-color: #558b2f;
    border-top-color: rgba(85, 139, 47, 0.35);
}

.history-book-sim__li--strategy-tz-sum .history-book-sim__m-title {
    color: #c5e1a5;
}

body.theme-light .history-book-sim__li--strategy-tz-sum .history-book-sim__m-title {
    color: var(--accent-dim);
}

.history-book-sim__scope-note {
    margin: 0 0 0.75rem 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.14);
}

body.theme-light .history-book-sim__scope-note {
    background: rgba(0, 0, 0, 0.04);
}

.history-book-sim__full-list-label {
    font-weight: 600;
    color: var(--text-primary);
}

.history-pager-key {
    font-size: 0.82em;
    opacity: 0.88;
    font-weight: normal;
}

/* strategy-target: цвет рамки задаётся в .history-book-sim__li--market-recv_* */

.history-book-sim__lead--compact {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.history-book-sim__lead--fine {
    font-size: 0.8rem;
    opacity: 0.92;
    margin-top: -0.35rem;
}

.history-book-sim__lead,
.history-book-sim__total,
.history-book-sim__note {
    margin: 0 0 0.65rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.history-book-sim__total {
    color: var(--text-primary);
}

.history-book-sim__list {
    margin: 0 0 0.65rem 0;
    padding-left: 0;
    list-style: none;
    font-size: 0.86rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.82);
}

body.theme-light .history-book-sim__list {
    color: rgba(0, 0, 0, 0.78);
}

.history-book-sim__list > li {
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.55rem 0.45rem 0.65rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    border-left: 3px solid rgba(255, 255, 255, 0.14);
}

body.theme-light .history-book-sim__list > li {
    background: rgba(0, 0, 0, 0.04);
    border-left-color: rgba(0, 0, 0, 0.12);
}

.history-book-sim__m-title {
    color: var(--text-primary);
    font-weight: 600;
}

.history-book-sim__m-odd {
    color: #c5e1a5;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

body.theme-light .history-book-sim__m-odd {
    color: var(--accent-dim);
}

.history-book-sim__m-stat {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.92em;
    line-height: 1.5;
}

.history-book-sim__stat-label {
    color: rgba(255, 255, 255, 0.52);
    font-weight: normal;
}

body.theme-light .history-book-sim__stat-label {
    color: rgba(0, 0, 0, 0.48);
}

.history-book-sim__stat-checks {
    color: #90caf9;
    font-weight: 700;
}

body.theme-light .history-book-sim__stat-checks {
    color: #1565c0;
}

.history-book-sim__stat-stake {
    color: #fff9c4;
    font-weight: 700;
}

body.theme-light .history-book-sim__stat-stake {
    color: #f57f17;
}

.history-book-sim__stat-wins {
    color: var(--correct);
    font-weight: 700;
}

.history-book-sim__stat-losses {
    color: var(--incorrect);
    font-weight: 700;
}

.history-book-sim__stat-pl--pos {
    color: var(--correct);
    font-weight: 700;
}

.history-book-sim__stat-pl--neg {
    color: var(--incorrect);
    font-weight: 700;
}

.history-book-sim__stat-pl--zero {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

body.theme-light .history-book-sim__stat-pl--zero {
    color: rgba(0, 0, 0, 0.45);
}

.history-book-sim__offer-split {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9em;
}

body.theme-light .history-book-sim__offer-split {
    color: rgba(0, 0, 0, 0.5);
}

.history-book-sim__offer-script {
    color: #81d4fa;
    font-weight: 600;
}

body.theme-light .history-book-sim__offer-script {
    color: #0277bd;
}

.history-book-sim__offer-ai {
    color: #ce93d8;
    font-weight: 600;
}

body.theme-light .history-book-sim__offer-ai {
    color: #7b1fa2;
}

.history-book-sim__offer-pending {
    font-weight: normal;
    opacity: 0.85;
}

/* Целевые рынки 30:40 / 15:40 / 0:40 — зелёная полоска слева (специфичность выше базового li) */
.history-book-sim__list > li.history-book-sim__li--market-recv_3040,
.history-book-sim__list > li.history-book-sim__li--market-recv_1540,
.history-book-sim__list > li.history-book-sim__li--market-recv_040,
.history-book-sim__list > li.history-book-sim__li--strategy-tz-sum {
    border-left: 3px solid #7cb342;
    background: rgba(124, 179, 66, 0.12);
}

body.theme-light .history-book-sim__list > li.history-book-sim__li--market-recv_3040,
body.theme-light .history-book-sim__list > li.history-book-sim__li--market-recv_1540,
body.theme-light .history-book-sim__list > li.history-book-sim__li--market-recv_040,
body.theme-light .history-book-sim__list > li.history-book-sim__li--strategy-tz-sum {
    border-left-color: #558b2f;
    background: rgba(85, 139, 47, 0.09);
}

.history-book-sim__target-group .history-book-sim__list > li.history-book-sim__li--strategy-tz-sum {
    background: rgba(124, 179, 66, 0.16);
}

body.theme-light .history-book-sim__target-group .history-book-sim__list > li.history-book-sim__li--strategy-tz-sum {
    background: rgba(85, 139, 47, 0.11);
}

.history-book-sim__li--market-recv_3040 .history-book-sim__m-odd {
    color: #aed581;
}

.history-book-sim__li--market-recv_1540 .history-book-sim__m-odd {
    color: #c5e1a5;
}

.history-book-sim__li--market-recv_040 .history-book-sim__m-odd {
    color: #dce775;
}

/* Подающий */
.history-book-sim__li--market-srv_4030,
.history-book-sim__li--market-srv_a40 {
    border-left-color: #64b5f6;
    background: rgba(100, 181, 246, 0.08);
}

body.theme-light .history-book-sim__li--market-srv_4030,
body.theme-light .history-book-sim__li--market-srv_a40 {
    border-left-color: #1976d2;
    background: rgba(25, 118, 210, 0.06);
}

.history-book-sim__li--market-srv_4030 .history-book-sim__m-odd,
.history-book-sim__li--market-srv_a40 .history-book-sim__m-odd {
    color: #90caf9;
}

/* Прочие приёмник */
.history-book-sim__li--market-recv_40a,
.history-book-sim__li--market-recv_rally {
    border-left-color: #4db6ac;
    background: rgba(77, 182, 172, 0.08);
}

.history-book-sim__li--market-deuce_4040 {
    border-left-color: #ffb74d;
    background: rgba(255, 183, 77, 0.08);
}

.history-book-sim__li--market-rallies_gt_55 {
    border-left-color: #ba68c8;
    background: rgba(186, 104, 200, 0.08);
}

.history-book-sim__li--strategy-target {
    padding-left: 0.55rem;
}

.history-book-sim__li--has-checklist .history-book-sim__recv1540-details {
    margin: 0 0 0.2rem 0;
    padding: 0.3rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.12);
}

body.theme-light .history-book-sim__li--has-checklist .history-book-sim__recv1540-details {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
}

.history-book-sim__recv1540-summary {
    cursor: pointer;
    line-height: 1.45;
    list-style: none;
    display: block;
}

.history-book-sim__recv1540-summary::-webkit-details-marker,
.history-book-sim__recv1540-summary::marker {
    display: none;
    content: '';
}

.history-book-sim__recv1540-summary .history-book-sim__m-title {
    color: var(--text-primary);
}

.history-book-sim__recv1540-summary .history-book-sim__m-odd {
    white-space: normal;
}

.history-book-sim__recv1540-summary-hint {
    font-size: 0.88em;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.55);
}

body.theme-light .history-book-sim__recv1540-summary-hint {
    color: rgba(0, 0, 0, 0.5);
}

.history-book-sim__recv1540-summary-action {
    color: #aed581;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.theme-light .history-book-sim__recv1540-summary-action {
    color: var(--accent-dim);
}

.history-book-sim__li--has-checklist .history-book-sim__m-stat {
    display: block;
    margin-top: 0.12rem;
}

.history-book-sim__recv1540-list {
    margin: 0.4rem 0 0.2rem 0;
    padding: 0.35rem 0.4rem 0.35rem 0.75rem;
    font-size: 0.86em;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.12);
    list-style: disc;
}

body.theme-light .history-book-sim__recv1540-list {
    color: rgba(0, 0, 0, 0.72);
    background: rgba(0, 0, 0, 0.03);
}

.history-book-sim__recv1540-list li {
    margin-bottom: 0.35rem;
}

.history-book-sim__recv1540-list .history-book-sim__score-srvrecv {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.92em;
}

.history-book-sim__win-check {
    display: inline-block;
    margin-left: 0.1em;
    color: #4caf50;
    font-weight: 700;
    line-height: 1;
    vertical-align: 0.05em;
}

body.theme-light .history-book-sim__win-check {
    color: #2e7d32;
}

/* Как у глобального .serve-dot: 9px + margin-right — отступ слева, если мячик только в конце строки */
.history-book-sim__recv1540-players--guest-serves {
    display: inline-block;
    padding-left: calc(9px + 0.35em);
    max-width: 100%;
    box-sizing: border-box;
}

.history-book-sim__recv1540-list .serve-dot {
    vertical-align: 0.05em;
}

.history-book-sim__recv1540-link {
    color: var(--accent, #7eb8ff);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.history-book-sim__recv1540-link:hover {
    opacity: 0.9;
}

.history-book-sim__recv1540-nolink {
    color: var(--text-primary);
}

.history-book-sim__empty {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.history-score-accuracy-note {
    margin: 0.45rem 0 0.85rem;
    padding: 0.55rem 0.75rem;
    max-width: 52rem;
    font-size: 0.74rem;
    line-height: 1.55;
    color: var(--text-secondary);
    border-radius: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.025);
}

body.theme-light .history-score-accuracy-note {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.025);
    color: rgba(0, 0, 0, 0.58);
}

.history-score-accuracy-note__label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.82;
}

.history-pager--seo {
    margin: 0.75rem 0 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

body.theme-light .history-pager--seo {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
}

.history-event--seo {
    margin: 1rem 0 1.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .history-event--seo {
    border-color: rgba(0, 0, 0, 0.08);
}

.history-event--seo .history-event-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.history-seo-records {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.history-seo-note {
    margin: 1rem 0 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.85;
}

.history-event-restricted {
    margin: 0.5rem 0 0.35rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.88rem;
    line-height: 1.45;
    border-radius: 6px;
    border-left: 3px solid #e65100;
    background: rgba(230, 81, 0, 0.12);
    color: var(--text-secondary);
}

body.theme-light .history-event-restricted {
    background: rgba(230, 81, 0, 0.08);
    color: rgba(0, 0, 0, 0.72);
}

.history-event-restricted--unban {
    border-left-color: #2e7d32;
    background: rgba(46, 125, 50, 0.12);
}

body.theme-light .history-event-restricted--unban {
    background: rgba(46, 125, 50, 0.08);
}

.history-event-restricted--permanent {
    border-left-color: #b71c1c;
    background: rgba(183, 28, 28, 0.14);
    color: var(--text-secondary);
}

body.theme-light .history-event-restricted--permanent {
    background: rgba(183, 28, 28, 0.09);
    color: rgba(0, 0, 0, 0.78);
}

.history-restriction-marker {
    margin: 0.35rem 0;
}

.history-description {
    display: block;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 1rem;
    line-height: 1.5;
}

body.theme-light .history-description {
    background: rgba(0, 0, 0, 0.04);
}

/* Карточка подписки на push (главная) */
.push-card {
    position: relative;
    margin: 0 0 1rem 0;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(124, 179, 66, 0.35);
    background: linear-gradient(135deg, rgba(30, 54, 30, 0.95) 0%, rgba(36, 61, 36, 0.88) 100%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

body.theme-light .push-card {
    background: linear-gradient(135deg, #f0f4e8 0%, #ffffff 100%);
    border-color: rgba(85, 139, 47, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.push-card__glow {
    position: absolute;
    top: -40%;
    right: -10%;
    width: 55%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(212, 237, 79, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.push-card__main {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.85rem 1rem;
    padding: 1rem 1.1rem;
}

.push-card__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(124, 179, 66, 0.2);
    color: var(--accent);
}

.push-card__icon svg {
    width: 28px;
    height: 28px;
}

.push-card__body {
    flex: 1 1 200px;
    min-width: 0;
}

.push-card__title {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.push-card__text {
    margin: 0 0 0.5rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.push-card__text strong {
    color: var(--accent);
    font-weight: 700;
}

.push-card__status {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
    min-height: 1.2em;
}

.push-card__status:empty {
    display: none;
}

.push-card--active .push-card__status {
    color: var(--correct);
}

.push-card--active {
    border-color: rgba(129, 199, 132, 0.55);
    box-shadow: 0 6px 24px rgba(124, 179, 66, 0.15);
}

.push-card--unsupported {
    border-color: rgba(144, 164, 174, 0.4);
    opacity: 0.92;
}

.push-card__hint {
    margin: 0.35rem 0 0 0;
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--interrupted);
}

.push-card__actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    width: 100%;
}

@media (min-width: 560px) {
    .push-card__actions {
        width: auto;
        min-width: 11.5rem;
        align-self: center;
    }
}

.push-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.push-card__btn:active {
    transform: scale(0.98);
}

.push-card__btn--primary {
    color: #1a241a;
    background: linear-gradient(135deg, #d4ed4f 0%, #7cb342 100%);
    box-shadow: 0 3px 14px rgba(124, 179, 66, 0.45);
}

.push-card__btn--primary:hover {
    box-shadow: 0 4px 18px rgba(124, 179, 66, 0.55);
}

.push-card__btn--enabled {
    color: #0f1d10;
    background: linear-gradient(135deg, #a5d6a7 0%, #66bb6a 100%);
    box-shadow: 0 3px 14px rgba(102, 187, 106, 0.35);
    cursor: default;
}

.push-card__btn--enabled:hover {
    box-shadow: 0 3px 14px rgba(102, 187, 106, 0.35);
}

.push-card__btn--ghost {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--divider);
}

.push-card__btn--ghost:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.push-card--unsupported .push-card__btn--primary {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.push-card__btn-icon {
    font-size: 1.05em;
    line-height: 1;
}

.index-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.index-toolbar label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.index-toolbar .toggle-wrap {
    flex-shrink: 0;
}

.predictions-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.prediction-item {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}

.prediction-item:hover {
    opacity: 0.95;
}

/* Маркер «просмотрено»: цветная полоска слева, при клике по карточке снимается/ставится; снимается при обновлении прогноза */
.prediction-item.viewed {
    border-left-color: var(--accent);
    opacity: 0.75;
}

.prediction-item--hold .recommendation {
    color: var(--accent);
}

.prediction-item--winner .recommendation {
    color: var(--interrupted);
}

.prediction-item__ai-tag {
    font-size: 0.85em;
    color: var(--text-muted, #888);
    font-weight: 500;
}

.prediction-item.prediction-changed {
    box-shadow: 0 0 0 2px var(--interrupted);
    background: rgba(255, 183, 77, 0.15);
    animation: prediction-highlight 4s ease-out forwards;
}

@keyframes prediction-highlight {
    0% {
        box-shadow: 0 0 0 2px var(--interrupted);
        background: rgba(255, 183, 77, 0.35);
    }
    100% {
        box-shadow: 0 0 0 2px transparent;
        background: var(--bg-card);
    }
}

.prediction-item.prediction-removing {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none;
}

.prediction-item .tournament {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.prediction-item .players {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.serve-dot,
.prediction-item .players .serve-dot {
    color: var(--accent);
    font-weight: 700;
}

.prediction-item .match-score {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9em;
    word-break: break-word;
}

.prediction-match-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.prediction-match-link:hover {
    text-decoration: underline;
}

/* Шапка матча без ссылки на якорь в истории (события ещё нет в списке history.html). */
.prediction-match-heading {
    display: block;
    color: inherit;
}

.prediction-match .match-game-winner {
    text-decoration: underline;
}

/* Подробный счёт по геймам на главной (index.html) — структура 2xN, как в истории. */
.prediction-item .match-games-table {
    display: inline-table;
    border-collapse: collapse;
    border-spacing: 0;
    margin-left: 0.25rem;
    table-layout: fixed;
    vertical-align: baseline;
}

.prediction-item .match-games-cell {
    padding: 0 0.25rem;
    text-align: center;
    vertical-align: top;
    width: 3.9rem;
}

.prediction-item .match-games-cell--idx {
    font-size: 0.7rem;
    opacity: 0.8;
    padding-top: 0.1rem;
}

.prediction-item .match-games-cell .serve-dot {
    margin: 0 0.15em;
}

.serve-dot,
.prediction-item .serve-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: middle;
    margin-right: 0.35em;
}

.prediction-item .player-pick {
    color: #64b5f6;
    font-weight: 700;
}

.prediction-item .recommendation {
    color: var(--accent);
    font-size: 0.95rem;
}

.predictions-list .prediction-block--service_hold .recommendation,
.prediction-item--hold:not(.prediction-item--winner) .recommendation {
    color: var(--accent);
}

.predictions-list .prediction-block--match_winner .recommendation,
.prediction-item--winner:not(.prediction-item--hold) .recommendation {
    color: var(--prediction-winner);
}

.prediction-block {
    margin-bottom: 0.35rem;
}

.prediction-block:last-child {
    margin-bottom: 0;
}

.prediction-item--bad-hold-stats {
    background: rgba(229, 115, 115, 0.2);
}

.prediction-item--good-hold-stats {
    background: rgba(129, 199, 132, 0.15);
}

.prediction-item--result-correct {
    background: rgba(129, 199, 132, 0.22);
    border-left-color: var(--correct);
}

.prediction-item--result-incorrect {
    background: rgba(229, 115, 115, 0.28);
    border-left-color: var(--incorrect);
}

.prediction-item--result-neutral {
    background: rgba(255, 183, 77, 0.12);
    border-left-color: var(--pending);
}

.prediction-outcome {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-right: 0.35rem;
    vertical-align: baseline;
}

.prediction-outcome--correct {
    color: var(--correct);
}

.prediction-outcome--incorrect {
    color: var(--incorrect);
}

.prediction-outcome--neutral {
    color: var(--pending);
}

.prediction-block--bad-stats {
    background: rgba(229, 115, 115, 0.35);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    margin: 0.25rem 0;
}

.prediction-block--good-stats {
    background: rgba(129, 199, 132, 0.25);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    margin: 0.25rem 0;
}

.prediction-hold-stats {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.prediction-hold-stats--bad,
.prediction-hold-stats--good {
    color: var(--text-primary);
    font-weight: 600;
}

.prediction-hold-stats .hold-stats-correct {
    color: var(--correct);
}

.prediction-hold-stats .hold-stats-incorrect {
    color: var(--incorrect);
}

.hold-stats-sequence {
    margin-left: 0.35rem;
    font-weight: 700;
}

.hold-stats-sequence .hold-seq-v {
    color: var(--correct);
}

.hold-stats-sequence .hold-seq-x {
    color: var(--incorrect);
}

.hold-stats-sequence .hold-seq-muted {
    opacity: 0.4;
}

.prediction-item .probability {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.deepseek-note {
    font-size: 0.8rem;
    color: var(--pending);
    margin-top: 0.2rem;
}

.prediction-item--deepseek-bet .deepseek-note {
    color: var(--correct);
    font-weight: 600;
}

.prediction-item--deepseek-skip .deepseek-note {
    color: var(--incorrect);
    font-weight: 600;
}

/* DeepSeek: отдельная рекомендация на следующий гейм (в шапке матча) */
.prediction-match-deepseek-suggest {
    margin-top: 0.5rem;
}

.deepseek-suggest {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-light .deepseek-suggest {
    background: rgba(0, 0, 0, 0.03);
}

.deepseek-suggest--pending {
    color: var(--pending);
}

.deepseek-suggest--bet {
    color: var(--correct);
    font-weight: 700;
}

.deepseek-suggest--skip {
    color: var(--incorrect);
    font-weight: 700;
}

.deepseek-suggest--none {
    color: var(--pending);
}

/* Бесплатный ИИ (Groq) */
.prediction-match-groq-suggest {
    margin-top: 0.5rem;
}

.groq-suggest,
.free-ai-suggest {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.5;
}

.free-ai-suggest__head {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.free-ai-suggest__lead {
    display: block;
    margin-bottom: 0.35rem;
}

.free-ai-suggest__reason {
    display: block;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(144, 164, 174, 0.22);
}

.free-ai-suggest__reason-label {
    font-weight: 600;
    color: var(--text-primary);
}

body.theme-light .groq-suggest,
body.theme-light .free-ai-suggest {
    background: rgba(0, 0, 0, 0.03);
}

.groq-suggest--bet,
.free-ai-suggest--bet {
    color: var(--correct);
    font-weight: 700;
}

.groq-suggest--skip,
.free-ai-suggest--skip {
    color: var(--incorrect);
    font-weight: 700;
}

.free-ai-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    background: rgba(46, 160, 130, 0.18);
    color: #2ea082;
    border: 1px solid rgba(46, 160, 130, 0.35);
}

.history-item--free-ai {
    border-left: 3px solid rgba(46, 160, 130, 0.55);
}

.prediction-previous {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--divider);
}

.prediction-previous-toggle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.prediction-previous-toggle::before {
    content: '▶ ';
}

.prediction-item.prediction-expanded .prediction-previous-toggle::before {
    content: '▼ ';
}

.prediction-previous-list {
    display: none;
    margin-top: 0.35rem;
}

.prediction-item.prediction-expanded .prediction-previous-list {
    display: block;
}

.prediction-previous-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.2rem 0;
    border-bottom: 1px dashed var(--divider);
}

.prediction-previous-item:last-child {
    border-bottom: none;
}

.prediction-previous-rec {
    display: block;
}

.prediction-previous-prob {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Счёт гейма в скобках: нейтраль без зелёного оттенка (--text-secondary), чтобы не сливаться с «угадано». */
.game-score-hint {
    color: #c9c1b8;
    font-weight: 500;
}

body.theme-light .game-score-hint {
    color: #5a5550;
}

.game-score-side {
    font-weight: 500;
}

.game-score-side--good {
    color: var(--correct);
    font-weight: 700;
}

.game-score-side--bad {
    color: var(--incorrect);
    font-weight: 700;
}

/* Главная страница: группировка прогнозов по матчу */
.prediction-match {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.prediction-match-header {
    margin-bottom: 0.4rem;
}

.prediction-match-header .history-event-meta {
    margin-top: 4px;
    margin-bottom: 2px;
}

.prediction-match-header .tournament {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.prediction-match-header .players {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.prediction-match-header .match-score {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.prediction-match-body .prediction-item {
    margin-top: 0.3rem;
}

.prediction-match-body .prediction-item:first-child {
    margin-top: 0.1rem;
}

/* Страница настроек */
.page-settings .settings-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.page-settings .settings-section h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--accent);
}

.page-settings .settings-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: -0.25rem 0 0.75rem 0;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--divider);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    flex: 1;
    min-width: 140px;
}

.setting-row input[type="number"],
.setting-row input[type="text"],
.setting-row input[type="password"],
.setting-row select {
    background: var(--bg-page);
    border: 1px solid var(--divider);
    color: var(--text-primary);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    min-width: 100px;
}

.setting-row select {
    cursor: pointer;
}

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle {
    width: 48px;
    height: 26px;
    background: var(--divider);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.on {
    background: var(--accent);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle.on::after {
    transform: translateX(22px);
}

/* История */
.history-summary {
    margin-bottom: 1rem;
}

.history-summary-box {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.history-summary-box .summary-correct {
    color: var(--correct);
    font-weight: 700;
}

.history-summary-box .summary-incorrect {
    color: var(--incorrect);
    font-weight: 700;
}

.history-summary-box .summary-total,
.history-item .rally-breakdown {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.history-actions .btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--divider);
}

.history-actions .btn:hover {
    background: var(--divider);
}

.history-actions .btn-danger {
    background: rgba(229, 115, 115, 0.2);
    border-color: var(--incorrect);
    color: #ffcdd2;
}

.history-actions .btn-danger:hover {
    background: rgba(229, 115, 115, 0.35);
}

.history-load-more {
    display: block;
    margin: 1rem auto 1.5rem;
    min-width: 12rem;
}

.history-event {
    margin-bottom: 1.5rem;
}

.history-event-header {
    background: var(--bg-header);
    padding: 0.6rem 1rem;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--divider);
    border-bottom: none;
}

.history-event-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.history-event-players {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.history-event-players .serve-dot {
    color: var(--accent);
}

.history-event-score {
    margin-bottom: 0;
}

.history-event-score-panel {
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.5rem 0.35rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

body.theme-light .history-event-score-panel {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--divider);
}

.history-event-score-panel .history-event-score {
    margin-bottom: 0.2rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .history-event-score-panel .history-event-score {
    border-bottom-color: var(--divider);
}

.history-event-score-panel .history-event-score-detail {
    margin-bottom: 0;
}

.history-event-score-panel .history-event-score-detail:only-child,
.history-event-score-panel .history-event-score:only-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.history-event-toolbar:empty {
    display: none;
}

.history-match-score {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.history-match-score__label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.history-match-score__parts {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.45rem;
}

.history-score-chip {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    background: rgba(124, 179, 66, 0.14);
    border: 1px solid rgba(124, 179, 66, 0.28);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

body.theme-light .history-score-chip {
    background: rgba(85, 139, 47, 0.1);
    border-color: rgba(85, 139, 47, 0.22);
    box-shadow: none;
}

.history-score-chip--major {
    font-size: 1.02rem;
    padding: 0.18rem 0.55rem;
    background: rgba(124, 179, 66, 0.22);
    border-color: rgba(124, 179, 66, 0.42);
}

body.theme-light .history-score-chip--major {
    background: rgba(85, 139, 47, 0.16);
    border-color: rgba(85, 139, 47, 0.35);
}

.history-score-chip--set {
    font-size: 0.92rem;
    margin-right: 0.15rem;
}

.history-score-group {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.1rem;
}

.history-score-group__open,
.history-score-group__close {
    color: var(--text-secondary);
    font-weight: 600;
    opacity: 0.75;
    font-size: 0.95em;
}

.history-score-group__sep {
    color: var(--text-secondary);
    opacity: 0.55;
    margin: 0 0.08rem;
    font-weight: 500;
}

.history-match-score--compact {
    gap: 0;
}

.history-score-compact__line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.45rem;
    line-height: 1.25;
}

.history-score-compact__games,
.history-score-compact__points {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.history-score-compact__keys {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin-top: 0.12rem;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.85;
}

.history-score-compact__keys span:not(:last-child)::after {
    content: '·';
    margin: 0 0.35rem;
    opacity: 0.55;
    font-weight: 400;
}

.history-set-header--compact {
    min-width: auto;
    gap: 0.2rem 0.3rem;
}

.history-set-header__num {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    line-height: 1;
}

.history-set-header--compact .history-set-header__live {
    font-size: 0.55rem;
    padding: 0;
    border: none;
    background: none;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
}

.history-score-board__legend--compact {
    margin-top: 0.3rem;
    font-size: 0.65rem;
    line-height: 1.35;
}

.history-legend-accent {
    color: var(--accent);
    font-weight: 500;
}

.history-legend-hold {
    color: #3b82f6;
    font-weight: 600;
}

.history-legend-break {
    color: #c2415c;
    font-weight: 600;
}

.history-score-board {
    margin-bottom: 0.15rem;
}

.history-score-board__sets {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.history-set-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.2rem 0.3rem;
    padding: 0.25rem 0.35rem 0.3rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-set-header {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.3rem;
    flex-shrink: 0;
}

.history-score-board__legend {
    margin: 0.3rem 0 0;
    font-size: 0.65rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

body.theme-light .history-set-line {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--divider);
}

.history-set-total {
    flex-shrink: 0;
}

.history-event-score-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.35;
}

/* Сжатый список очков в скобках (fallback без таблицы) — не ячейки геймов в таблице */
.history-event-score-detail > .history-score-board .history-score-detail,
.history-set-line > .history-score-group .history-score-detail {
    color: var(--accent);
    font-weight: 500;
}

.history-event-score-detail .history-games-cell .history-score-detail {
    color: var(--accent);
    font-weight: 500;
}

.history-event-score-detail .history-games-table {
    display: inline-table;
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 0;
    table-layout: fixed;
    vertical-align: baseline;
}

.history-event-score-detail .history-games-wrap {
    display: inline-block;
    margin-left: 0.15rem;
}

.history-event-score-detail .history-games-cell {
    padding: 0 0.25rem;
    text-align: center;
    vertical-align: top;
    width: 3.9rem;
}

/* Не даём "40:A ✓" переноситься на новую строку */
.history-event-score-detail .history-games-cell .history-score-detail {
    white-space: nowrap;
    display: inline-block;
}

.history-event-score-detail .history-games-cell--idx {
    font-size: 0.7rem;
    opacity: 0.92;
    padding-top: 0.1rem;
}

/* Накопительный счёт по геймам (2-я строка): синий — подающий выиграл гейм; красный — подающий проиграл (брейк). Не от прогнозов. */
.history-event-score-detail .history-idx-score {
    font-weight: 600;
}
.history-event-score-detail .history-idx-score--hold {
    color: #3b82f6;
}
.history-event-score-detail .history-idx-score--break {
    color: #c2415c;
}

.history-event-score-detail .history-serve-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: middle;
    margin: 0 0.15em;
}

.history-event-score-detail .history-game-winner {
    text-decoration: underline;
}

.history-event-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.history-log-box {
    margin: 0.4rem 0 0.6rem 0;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.history-log-pre {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    white-space: pre-wrap;
}

.history-event-score-detail .history-game-green-check,
.history-event-score-detail .history-games-cell .history-score-detail.history-game-green-check {
    color: var(--correct);
}
.history-event-score-detail .history-game-green-check::after {
    content: '\00a0✓';
    font-size: 0.75em;
    opacity: 0.9;
}
.history-event-score-detail .history-game-red-cross,
.history-event-score-detail .history-games-cell .history-score-detail.history-game-red-cross {
    color: var(--incorrect);
}
.history-event-score-detail .history-game-red-cross::after {
    content: '\00a0✗';
    font-size: 0.75em;
    opacity: 0.9;
}
.history-event-score-detail .history-game-gray-check,
.history-event-score-detail .history-games-cell .history-score-detail.history-game-gray-check {
    color: var(--text-secondary);
    opacity: 0.85;
}
.history-event-score-detail .history-game-gray-check::after {
    content: '\00a0✓';
    font-size: 0.75em;
    opacity: 0.7;
}
.history-event-score-detail .history-game-gray-cross {
    color: var(--text-secondary);
    opacity: 0.7;
}
.history-event-score-detail .history-game-gray-cross::after {
    content: '\00a0✗';
    font-size: 0.75em;
    opacity: 0.6;
}

.history-legend-green { color: var(--correct); }
.history-legend-red { color: var(--incorrect); }
.history-legend-gray { color: var(--text-secondary); opacity: 0.85; }

.history-event-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-event-stats .summary-correct {
    color: var(--correct);
    font-weight: 700;
}

.history-event-stats .summary-incorrect {
    color: var(--incorrect);
    font-weight: 700;
}

.history-event-games {
    border: 1px solid var(--divider);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.5rem;
    background: rgba(36, 61, 36, 0.4);
}

.history-event-games .history-item {
    margin-bottom: 0.4rem;
}

.history-event-games .history-item:last-child {
    margin-bottom: 0;
}

.history-item {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 5px solid var(--pending);
}

.history-item--not-suggested,
.history-item--not-suggested.result-correct,
.history-item--not-suggested.result-incorrect {
    background: var(--divider);
    opacity: 0.92;
}

.history-item--suggested.result-correct {
    border-left-color: var(--correct);
    background: rgba(129, 199, 132, 0.12);
}

.history-item--suggested.result-incorrect {
    border-left-color: var(--incorrect);
    background: rgba(229, 115, 115, 0.12);
}

.history-item--suggested.result-neutral {
    border-left-color: var(--pending);
    background: rgba(144, 164, 174, 0.14);
}

.history-item.result-interrupted {
    border-left-color: var(--interrupted);
}

.history-item--deepseek {
    box-shadow: 0 0 0 1px rgba(144, 164, 174, 0.6);
}

.history-item-wrap {
    margin-bottom: 0.4rem;
}

.history-item-wrap:last-child {
    margin-bottom: 0;
}

.history-previous {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--divider);
}

.history-previous-toggle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.history-previous-toggle::before {
    content: '▶ ';
}

.history-item-wrap.history-expanded .history-previous-toggle::before {
    content: '▼ ';
}

.history-previous-list {
    display: none;
    margin-top: 0.35rem;
}

.history-item-wrap.history-expanded .history-previous-list {
    display: block;
}

.history-previous-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.2rem 0;
    border-bottom: 1px dashed var(--divider);
}

.history-previous-item:last-child {
    border-bottom: none;
}

.history-previous-meta {
    font-size: 0.75rem;
    opacity: 0.9;
}

.history-event--highlight {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.8);
    border-radius: 6px;
}

.history-item .history-item-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
}

.history-item-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.history-item .probability--deepseek-line,
.history-item .probability--free-ai-line {
    margin-top: 0.2rem;
}

.history-item .history-prob-emph--good {
    color: var(--correct);
    font-weight: 700;
}

.history-item .history-prob-emph--bad {
    color: var(--incorrect);
    font-weight: 700;
}

.history-item .history-prob-emph--neutral {
    color: var(--pending);
    font-weight: 600;
}

.history-item .history-item-header .meta {
    margin-bottom: 0;
}

.history-item .meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.history-item .result-badge {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    flex-shrink: 0;
}

.history-item .result-badge.correct {
    background: rgba(129, 199, 132, 0.3);
    color: var(--correct);
}

.history-item .result-badge.incorrect {
    background: rgba(229, 115, 115, 0.3);
    color: var(--incorrect);
}

.history-item .result-badge.interrupted {
    background: rgba(255, 183, 77, 0.3);
    color: var(--interrupted);
}

.history-item .result-badge.pending {
    background: rgba(144, 164, 174, 0.3);
    color: var(--pending);
}

.history-item .result-badge.neutral {
    background: rgba(144, 164, 174, 0.35);
    color: var(--pending);
    font-weight: 600;
}

.deepseek-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: rgba(144, 164, 174, 0.3);
    color: var(--pending);
    margin-left: 0.3rem;
}

.deepseek-badge--bet {
    background: rgba(129, 199, 132, 0.28);
    color: var(--correct);
}

.deepseek-badge--skip {
    background: rgba(229, 115, 115, 0.28);
    color: var(--incorrect);
}

.deepseek-badge-details {
    display: inline-block;
    margin-left: 0.3rem;
}

.deepseek-badge-details > summary {
    list-style: none;
    cursor: pointer;
}

.deepseek-badge-details > summary::-webkit-details-marker {
    display: none;
}

.deepseek-badge-popup {
    margin-top: 0.4rem;
    max-width: 34rem;
    font-size: 0.82rem;
    line-height: 1.35;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

body.theme-light .deepseek-badge-popup {
    background: rgba(255, 255, 255, 0.9);
}

.history-deepseek-note {
    margin: 0.55rem 0 0.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(144, 164, 174, 0.35);
    background: rgba(144, 164, 174, 0.12);
    font-size: 0.84rem;
    line-height: 1.45;
}

body.theme-light .history-deepseek-note {
    background: rgba(144, 164, 174, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

.history-deepseek-note--bet {
    border-color: rgba(129, 199, 132, 0.45);
    background: rgba(129, 199, 132, 0.1);
}

.history-deepseek-note--skip {
    border-color: rgba(229, 115, 115, 0.4);
    background: rgba(229, 115, 115, 0.08);
}

.history-deepseek-note__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
}

.history-deepseek-note__head .deepseek-badge {
    margin-left: 0;
}

.history-deepseek-note__title {
    font-weight: 600;
    color: var(--text-primary);
}

.history-deepseek-note__reason {
    color: var(--text-secondary);
    font-size: 0.92em;
    white-space: normal;
}

.history-deepseek-note--bet .history-deepseek-note__title {
    color: var(--correct);
}

.history-deepseek-note--skip .history-deepseek-note__title {
    color: var(--incorrect);
}

.history-free-ai-note {
    width: 100%;
    max-width: none;
    padding: 0.65rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.history-free-ai-note--bet {
    border-color: rgba(46, 160, 130, 0.45);
    background: rgba(46, 160, 130, 0.1);
}

.history-free-ai-note--skip {
    border-color: rgba(229, 115, 115, 0.38);
    background: rgba(229, 115, 115, 0.07);
}

.history-free-ai-note__title {
    flex: 1 1 12rem;
    min-width: 0;
}

.history-free-ai-note__lead {
    margin: 0.35rem 0 0.45rem;
    color: var(--text-secondary);
    font-size: 0.92em;
    line-height: 1.55;
}

.history-free-ai-note__reason {
    margin-top: 0.15rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(144, 164, 174, 0.22);
}

.history-free-ai-note__reason-label {
    font-weight: 600;
    color: var(--text-primary);
}

body.theme-light .history-free-ai-note__reason {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.history-script-note {
    margin: 0.55rem 0 0.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 179, 66, 0.38);
    background: rgba(124, 179, 66, 0.1);
    font-size: 0.84rem;
    line-height: 1.45;
}

body.theme-light .history-script-note {
    background: rgba(85, 139, 47, 0.08);
    border-color: rgba(85, 139, 47, 0.28);
}

.history-script-note__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
}

.history-script-note__head .script-badge {
    margin-left: 0;
}

.history-script-note__title {
    font-weight: 600;
    color: var(--accent);
}

.history-script-note__reason {
    color: var(--text-secondary);
    font-size: 0.92em;
    white-space: normal;
}

.script-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    margin-left: 0.3rem;
    background: rgba(121, 134, 203, 0.28);
    color: #dbe4ff;
}

body.theme-light .script-badge {
    color: #2f3b6a;
}

.mark-icon {
    font-size: 0.9em;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.mark-icon--green-check {
    color: var(--correct);
}

.mark-icon--red-cross {
    color: var(--incorrect);
}

.mark-icon--gray-check,
.mark-icon--gray-cross {
    color: var(--pending);
}

.mark-icon--neutral-dash {
    color: var(--pending);
    font-weight: 700;
    opacity: 0.95;
}

.history-event-updated {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0.2rem 0 0.35rem 0;
}

.history-event-score-detail .history-games-wrap {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.history-event-score-detail .history-games-table {
    font-size: clamp(0.62rem, 2.6vw, 0.82rem);
    white-space: nowrap;
}

.prediction-match--receiver-bad {
    border: 2px solid var(--incorrect);
    border-radius: 10px;
    box-sizing: border-box;
    box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.25), 0 4px 16px rgba(229, 57, 53, 0.12);
    background: linear-gradient(180deg, rgba(229, 57, 53, 0.07) 0%, transparent 42%);
}

body.theme-light .prediction-match--receiver-bad {
    background: linear-gradient(180deg, rgba(229, 57, 53, 0.06) 0%, #fff 45%);
    box-shadow: 0 0 0 1px rgba(198, 40, 40, 0.2), 0 2px 12px rgba(198, 40, 40, 0.1);
}

.history-event-score-detail .history-game-neutral,
.history-event-score-detail .history-games-cell .history-score-detail.history-game-neutral {
    color: var(--text-secondary);
    opacity: 0.85;
}

.game-score-hint .game-score-side--neutral {
    color: inherit;
    opacity: 0.88;
}

.save-btn {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

.save-btn:hover {
    background: var(--accent-dim);
}

/* Компактный блок «линия / сила» у матча (прогнозы + история) */
.match-insight {
    margin: 0.4rem 0 0.15rem 0;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    line-height: 1.38;
    color: var(--text-primary, #e8f0e8);
}

body.theme-light .match-insight {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.match-insight--history {
    margin: 0.35rem 0 0.25rem 0;
}

.match-insight__block + .match-insight__block {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

body.theme-light .match-insight__block + .match-insight__block {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.match-insight__label {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.88;
    margin-bottom: 0.25rem;
    color: var(--accent, #7cb87c);
}

.match-insight__bar-wrap {
    margin-top: 0.15rem;
}

.match-insight__bar-odds {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    line-height: 1.25;
}

.match-insight__bar-names {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    line-height: 1.2;
    opacity: 0.95;
}

.match-insight__bar-name {
    flex: 1 1 0;
    min-width: 0;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-insight__bar-name--left {
    text-align: left;
    font-weight: 600;
    color: var(--accent-dim, #9fd49f);
}

.match-insight__line-odd {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

body.theme-light .match-insight__line-odd {
    background: rgba(0, 0, 0, 0.06);
}

.match-insight__line-odd--left {
    text-align: left;
}

.match-insight__line-odd--right {
    text-align: right;
    margin-left: auto;
}

.match-insight--history .match-insight__bar-odds {
    margin-bottom: 0.25rem;
}

@media (max-width: 520px) {
    .match-insight__bar-odds {
        font-size: 0.76rem;
    }

    .match-insight__bar-names {
        font-size: 0.7rem;
    }

    .match-insight__line-odd {
        font-size: 0.76rem;
        padding: 0.14rem 0.45rem;
    }
}

.match-insight__bar-name--right {
    text-align: right;
    font-weight: 600;
    color: #7eb8e8;
}

body.theme-light .match-insight__bar-name--right {
    color: #2a6fa8;
}

body.theme-light .match-insight__bar-name--left {
    color: #3d7a3d;
}

.match-insight__bar-track {
    display: flex;
    height: 8px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

body.theme-light .match-insight__bar-track {
    background: rgba(0, 0, 0, 0.06);
}

.match-insight__bar-seg {
    display: block;
    height: 100%;
    min-width: 3px;
    transition: width 0.2s ease;
}

.match-insight__bar-seg--p1 {
    background: linear-gradient(90deg, var(--accent, #4a8a4a), var(--accent-dim, #6cb86c));
}

.match-insight__bar-seg--p2 {
    background: linear-gradient(90deg, #4a7aaa, #6a9fd4);
}

.match-insight__bar-track--strength .match-insight__bar-seg--p1 {
    opacity: 0.92;
}

.match-insight__bar-track--strength .match-insight__bar-seg--p2 {
    opacity: 0.88;
}

.match-insight__bar-pcts {
    display: flex;
    justify-content: space-between;
    margin-top: 0.18rem;
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.92;
}

.match-insight__pct-note-block {
    margin-top: 0.15rem;
}

/* legacy single-fill bar (если где-то остался старый markup) */
.match-insight__bar {
    height: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

body.theme-light .match-insight__bar {
    background: rgba(0, 0, 0, 0.08);
}

.match-insight__bar-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent, #5a9a5a), var(--accent-dim, #7cb87c));
}

.match-insight__bar--adj .match-insight__bar-fill {
    opacity: 0.92;
}

.match-insight__pct {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    opacity: 0.95;
}

.match-insight__pct-note {
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.72rem;
}

.match-insight__odds {
    margin-top: 0.15rem;
    font-size: 0.76rem;
    opacity: 0.9;
    font-variant-numeric: tabular-nums;
}

.match-insight__lead {
    margin-top: 0.2rem;
    font-weight: 500;
}

.match-insight__ctx {
    margin-top: 0.12rem;
    font-size: 0.74rem;
    opacity: 0.88;
}

.match-insight__hint,
.match-insight__sub {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    opacity: 0.78;
    line-height: 1.35;
}

/* ============ COOKIE-БАННЕР ============ */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(30, 54, 30, 0.97) 0%, rgba(15, 36, 16, 0.99) 100%);
    border-top: 1px solid rgba(124, 179, 66, 0.35);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    color: var(--text-primary);
}

body.theme-light .cookie-banner {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 245, 240, 0.99) 100%);
    border-top-color: var(--divider);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
}

.cookie-banner__inner {
    max-width: 800px;
    margin: 0 auto;
}

.cookie-banner__title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.cookie-banner__text {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.cookie-banner__text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.cookie-banner__link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cookie-banner__btn {
    font: inherit;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cookie-banner__btn--primary {
    background: var(--accent);
    color: #1a241a;
    border-color: var(--accent-dim);
    font-weight: 600;
}

.cookie-banner__btn--primary:hover {
    filter: brightness(1.08);
}

.cookie-banner__btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--divider);
}

.cookie-banner__btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

body.cookie-banner-visible {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

body.page-history.cookie-banner-visible {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

/* ============ СТРАНИЦА COOKIE ============ */
.legal-page {
    max-width: 720px;
}

.legal-page__title {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.legal-page__section {
    margin-bottom: 1.25rem;
}

.legal-page__section h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.legal-page__section p {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.legal-page__section code {
    font-size: 0.82em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
}

body.theme-light .legal-page__section code {
    background: rgba(0, 0, 0, 0.06);
}

.legal-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.legal-page__status {
    font-size: 0.85rem;
    color: var(--accent);
}

.legal-page__back {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

