.grid > * {
    min-width: 0;
}

.list,
#vb-history-dashboard,
#personal-content-wrapper {
    min-width: 0;
}

.result-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #0d182e;
    border: 1px solid #1f2b46;
    border-radius: 10px;
}

.result-filter-field {
    min-width: 170px;
    flex: 1 1 170px;
}

.result-filter-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.result-filter-field .input {
    width: 100%;
}

.result-filter-reset {
    align-self: end;
    min-width: 110px;
}

.personal-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #0d182e;
    border: 1px solid #1f2b46;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1rem;
    text-align: center;
    background: #111c33;
    border-radius: 8px;
    min-height: 108px;
}

.summary-item span {
    font-size: 0.9rem;
    color: #9ca3af;
}

.summary-item strong {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.dashboard-value {
    display: block;
    background: transparent;
    padding: 0;
}

.dashboard-value--win {
    color: #10b981;
}

.dashboard-value--loss {
    color: #ef4444;
}

.dashboard-value--neutral {
    color: #e6f0ff;
}

.chart-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #0d182e;
    border: 1px solid #1f2b46;
    border-radius: 10px;
    min-height: 0;
}

.result-filter-bar,
.personal-summary,
.chart-container,
.personal-results-table-wrapper,
.results-table-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.personal-feature-banner {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin: 0 0 1rem;
    padding: 0.95rem 1.1rem;
    background: #dff8ea;
    border: 1px solid #b6e8c8;
    border-radius: 12px;
    color: #14532d;
    line-height: 1.6;
}

.personal-feature-banner strong {
    flex: 0 0 auto;
    color: #166534;
}

.personal-feature-banner span {
    flex: 1 1 auto;
}

.results-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.results-panel-header strong {
    display: block;
    color: #e6f0ff;
    font-size: 1.05rem;
}

.results-panel-eyebrow {
    display: inline-block;
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #60a5fa;
}

.results-panel-meta {
    color: #9ca3af;
    font-size: 0.9rem;
}

.results-chart-toggle {
    display: inline-flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.3rem;
    background: rgba(17, 28, 51, 0.92);
    border: 1px solid #294062;
    border-radius: 999px;
}

.results-chart-toggle-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.results-chart-toggle-btn.is-active {
    background: #22c55e;
    color: #052e16;
}

.results-chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 320px;
}

.results-chart-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.results-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 10px;
}

.results-empty {
    padding: 1.25rem;
    text-align: center;
    background: #0d182e;
    border: 1px solid #1f2b46;
    border-radius: 10px;
    color: #e6f0ff;
}

.results-note {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #0d182e;
    color: #e6f0ff;
    border: 1px solid #1f2b46;
    border-radius: 10px;
}

.results-note h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #60a5fa;
}

.results-note p {
    margin: 0;
    line-height: 1.6;
}

.results-note-btn {
    margin-top: 1rem;
}

.results-note-error {
    margin-top: 1rem !important;
    color: #fca5a5;
}

.results-preview-title {
    margin: 0 0 1rem;
    text-align: center;
    color: #6b7280;
}

.results-table-section {
    margin-top: 1.75rem;
}

.results-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    padding: 1rem;
    background: #0d182e;
    border: 1px solid #1f2b46;
    border-radius: 10px;
}

.results-sort-group label,
.results-filter-group > span {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.results-sort-select {
    min-width: 220px;
}

.results-filter-group {
    flex: 1 1 360px;
}

.results-filter-group--market {
    flex-basis: 100%;
}

.results-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.results-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid #294062;
    border-radius: 999px;
    background: #111c33;
    color: #e6f0ff;
    font-size: 0.9rem;
    line-height: 1.3;
}

.results-filter-pill input {
    margin: 0;
}

.results-filter-total {
    color: #9ca3af;
    font-size: 0.9rem;
    white-space: nowrap;
}

.results-dashboard-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.55rem 0.8rem;
    border: 1px solid #294062;
    border-radius: 10px;
    background: #111c33;
    color: #e6f0ff;
    font-size: 0.9rem;
    line-height: 1.35;
}

.results-dashboard-toggle input {
    margin: 0;
}

.results-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.results-more-btn {
    min-width: 180px;
}

.personal-results-table-wrapper {
    overflow-x: auto;
}

.personal-results-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #0d182e;
    border: 1px solid #1f2b46;
    border-radius: 10px;
    overflow: hidden;
}

.personal-results-table th,
.personal-results-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #1f2b46;
    color: #e6f0ff;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: normal;
}

.personal-results-table th {
    line-height: 1.2;
}

.personal-results-table .col-date,
.personal-results-table .col-odd,
.personal-results-table .col-units,
.personal-results-table .col-stake,
.personal-results-table .col-result,
.personal-results-table .col-profit {
    white-space: nowrap;
}

.personal-results-table .col-match,
.personal-results-table .col-market,
.personal-results-table .col-bookmaker {
    white-space: normal;
}

.personal-results-table .col-odd,
.personal-results-table .col-units,
.personal-results-table .col-stake,
.personal-results-table .col-result,
.personal-results-table .col-profit {
    text-align: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

.personal-results-table .col-profit {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.personal-results-table th.col-bookmaker,
.personal-results-table th.col-result,
.personal-results-table th.col-profit {
    white-space: normal;
}

.personal-results-table .col-bookmaker {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.personal-results-table .col-date {
    width: 11%;
}

.personal-results-table--history .col-match,
.personal-results-table--personal .col-match {
    width: 18%;
}

.personal-results-table--history .col-market,
.personal-results-table--personal .col-market {
    width: 19%;
}

.personal-results-table--history .col-bookmaker {
    width: 10%;
}

.personal-results-table .col-odd {
    width: 5%;
}

.personal-results-table .col-units {
    width: 5%;
}

.personal-results-table .col-stake {
    width: 8%;
}

.personal-results-table .col-result {
    width: 11%;
}

.personal-results-table .col-profit {
    width: 13%;
}

.personal-results-table--personal .col-match {
    width: 22%;
}

.personal-results-table--personal .col-market {
    width: 25%;
}

.personal-results-table--personal .col-date {
    width: 12%;
}

.personal-results-table--personal .col-odd {
    width: 7%;
}

.personal-results-table--personal .col-units {
    width: 6%;
}

.personal-results-table--personal .col-stake {
    width: 9%;
}

.personal-results-table--personal .col-result {
    width: 11%;
}

.personal-results-table--personal .col-profit {
    width: 11%;
}

.table-segmented-text {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    line-height: 1.32;
}

.table-segmented-text span {
    display: block;
}

.col-market .table-segmented-text {
    color: #cbd5e1;
}

.col-market .table-segmented-text span:first-child {
    color: inherit;
}

.personal-results-table-wrapper {
    overflow-x: hidden;
}

.personal-results-table th {
    background: #111c33;
    font-weight: 700;
    color: #dbeafe;
}

.personal-results-table tbody tr:last-child td {
    border-bottom: none;
}

.personal-results-table tbody tr:hover {
    background: rgba(17, 28, 51, 0.92);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.24rem 0.52rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.status-pill--win {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.status-pill--loss {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.status-pill--neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.dashboard-profit {
    font-weight: 700;
}

.dashboard-profit--win {
    color: #10b981 !important;
}

.dashboard-profit--loss {
    color: #ef4444 !important;
}

.dashboard-profit--neutral {
    color: #cbd5e1 !important;
}

@media (max-width: 768px) {
    .result-filter-bar {
        padding: 0.85rem;
    }

    .result-filter-field,
    .result-filter-reset {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .personal-feature-banner {
        flex-direction: column;
        gap: 0.35rem;
    }

    .personal-summary {
        grid-template-columns: 1fr 1fr;
    }

    .summary-item {
        min-height: 96px;
        padding: 0.85rem;
    }

    .summary-item strong {
        font-size: 1.15rem;
    }

    .chart-container {
        min-height: 0;
    }

    .results-chart-canvas-wrap {
        height: 260px;
    }

    .results-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-chart-toggle {
        width: 100%;
        justify-content: center;
    }

    .results-table-toolbar {
        padding: 0.85rem;
    }

    .results-sort-group,
    .results-filter-group,
    .results-dashboard-toggle,
    .results-filter-total {
        flex: 1 1 100%;
        width: 100%;
    }

    .results-sort-select {
        width: 100%;
        min-width: 0;
    }

    .personal-results-table thead {
        display: none;
    }

    .personal-results-table,
    .personal-results-table tbody,
    .personal-results-table tr,
    .personal-results-table td {
        display: block;
        width: 100%;
    }

    .personal-results-table .col-date,
    .personal-results-table .col-match,
    .personal-results-table .col-market,
    .personal-results-table .col-bookmaker,
    .personal-results-table .col-odd,
    .personal-results-table .col-units,
    .personal-results-table .col-stake,
    .personal-results-table .col-result,
    .personal-results-table .col-profit {
        width: auto;
        max-width: none;
        white-space: normal;
    }

    .personal-results-table tr {
        margin-bottom: 1rem;
        border: 1px solid #1f2b46;
        border-radius: 8px;
        overflow: hidden;
        background: #111c33;
    }

    .personal-results-table td {
        display: grid;
        grid-template-columns: minmax(88px, 110px) minmax(0, 1fr);
        align-items: start;
        column-gap: 0.85rem;
        position: static;
        padding: 0.85rem 1rem;
        text-align: left;
        border-bottom: 1px solid #22314f;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .personal-results-table td:last-child {
        border-bottom: none;
    }

    .personal-results-table td::before {
        content: attr(data-label);
        display: block;
        position: static;
        width: auto;
        margin-bottom: 0;
        color: #9ca3af;
        font-weight: 700;
        white-space: normal;
        overflow-wrap: normal;
    }

    .personal-results-table .col-bookmaker {
        word-break: normal;
        overflow-wrap: normal;
    }

    .personal-results-table .col-result,
    .personal-results-table .col-profit,
    .personal-results-table .col-odd,
    .personal-results-table .col-units,
    .personal-results-table .col-stake {
        text-align: left;
    }

    .personal-results-table .table-segmented-text {
        gap: 0.12rem;
    }
}

[data-theme="light"] .result-filter-bar,
[data-theme="light"] .results-table-toolbar,
[data-theme="light"] .personal-summary,
[data-theme="light"] .chart-container,
[data-theme="light"] .results-empty,
[data-theme="light"] .results-note,
[data-theme="light"] .personal-results-table {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .personal-feature-banner {
    background: #dff8ea;
    border-color: #b6e8c8;
    color: #14532d;
}

[data-theme="light"] .summary-item,
[data-theme="light"] .results-filter-pill,
[data-theme="light"] .personal-results-table th {
    background: #f8fafc;
}

[data-theme="light"] .result-filter-field label,
[data-theme="light"] .results-sort-group label,
[data-theme="light"] .results-filter-group > span,
[data-theme="light"] .summary-item span,
[data-theme="light"] .results-panel-meta,
[data-theme="light"] .results-preview-title {
    color: #64748b;
}

[data-theme="light"] .col-market .table-segmented-text {
    color: #475569;
}

[data-theme="light"] .results-chart-empty {
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.35);
}

[data-theme="light"] .results-panel-header strong,
[data-theme="light"] .dashboard-value--neutral,
[data-theme="light"] .results-filter-pill,
[data-theme="light"] .results-dashboard-toggle,
[data-theme="light"] .personal-results-table th,
[data-theme="light"] .personal-results-table td,
[data-theme="light"] .results-empty,
[data-theme="light"] .results-note {
    color: #0f172a;
}

[data-theme="light"] .results-chart-toggle {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .results-chart-toggle-btn {
    color: #334155;
}

[data-theme="light"] .results-filter-pill {
    border-color: #cbd5e1;
}

[data-theme="light"] .results-dashboard-toggle {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .status-pill--neutral,
[data-theme="light"] .dashboard-profit--neutral {
    color: #475569 !important;
}

[data-theme="light"] .personal-results-table tbody tr:hover,
[data-theme="light"] .personal-results-table tbody tr:active {
    background: #f8fafc;
}

@media (max-width: 768px) {
    [data-theme="light"] .personal-results-table tr {
        background: #ffffff;
        border-color: #e5e7eb;
    }

    [data-theme="light"] .personal-results-table td {
        border-bottom-color: #e5e7eb;
    }

    [data-theme="light"] .personal-results-table td::before,
    [data-theme="light"] .result-filter-field label,
    [data-theme="light"] .summary-item span,
    [data-theme="light"] .results-panel-meta,
    [data-theme="light"] .results-preview-title {
        color: #64748b;
    }
}
