/* =========================
   ME DASHBOARD
   ========================= */
:root {
    --bg: #0b1020;
    --bg-2: #111827;
    --panel: #141b2d;
    --panel-2: #0f172a;
    --text: #e5e7eb;
    --muted: #9aa3b2;
    --accent: #e10600;
    --accent-2: #ffb100;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--text);
    --bg-accent: #ff8700;
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 12px),
        radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--bg-accent) 26%, transparent), transparent 40%),
        #050608;
}

body.theme-light {
    --bg: #cfd6e4;
    --bg-2: #d8dee9;
    --panel: #e2e7f0;
    --panel-2: #d2d9e6;
    --text: #101623;
    --muted: #4a5568;
    --accent: #e10600;
    --accent-2: #c47d00;
    --border: rgba(15, 23, 42, 0.16);
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 14px),
        radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--bg-accent) 14%, transparent), transparent 42%),
        radial-gradient(circle at top, #cfd6e4, #c1c9d7 55%, #b3bccd);
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(225, 6, 0, 0.08), transparent 40%),
        linear-gradient(300deg, rgba(255, 177, 0, 0.08), transparent 45%);
}

.glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.glow-a {
    background: #e10600;
    top: -120px;
    left: -80px;
}

.glow-b {
    background: #ffb100;
    bottom: -140px;
    right: -100px;
}

.topbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 28px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 11px;
    color: var(--muted);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.brand-f1 {
    color: var(--accent);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.04em;
}

.brand-name {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    font-size: 20px;
}

.brand-version {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.brand-version-toggle {
    border: none;
    background: linear-gradient(120deg, var(--accent), #ff4c3b);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    box-shadow: 0 8px 16px rgba(225, 6, 0, 0.35);
}

.brand-version-toggle:hover {
    filter: brightness(1.05);
}

.brand-version-toggle:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent),
        0 8px 16px rgba(225, 6, 0, 0.35);
}

#welcome {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

#welcomeGroups,
#sessionStatus,
#groupLabel {
    margin: 4px 0 0;
    font-size: 13px;
}

.welcome-username {
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
}

.topbar-actions a.ghost {
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
}

.topbar-actions .settings-link {
    min-width: 42px;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    border: none;
    background: linear-gradient(120deg, var(--accent), #ff4c3b);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(225, 6, 0, 0.35);
}

.ghost:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.topbar-actions .settings-link:hover {
    filter: brightness(1.05);
}

.topbar-actions .settings-link:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent),
        0 8px 16px rgba(225, 6, 0, 0.35);
}

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 28px 60px;
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 24px;
}

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

.panel {
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 6px),
        linear-gradient(160deg, rgba(20, 27, 45, 0.96), rgba(12, 18, 34, 0.96));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(5, 8, 16, 0.6);
}

body.theme-light .panel {
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.panel--wide {
    grid-column: 1 / -1;
}

@media (min-width: 1001px) {
    .panel--messages {
        grid-column: 1;
        grid-row: 2;
    }

    .panel--standings {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (min-width: 1280px) {
    .panel--messages .prefs-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .panel--messages .prefs-item {
        min-width: max-content;
        white-space: nowrap;
    }
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
}

.standings-filter {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.standings-filter label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.standings-filter select {
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 55%),
        linear-gradient(140deg, #1b1f24, #101316);
    color: #e5e7eb;
    border-radius: 10px;
    padding: 9px 34px 9px 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 180px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #ffffff 50%),
        linear-gradient(135deg, #ffffff 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px),
        calc(100% - 2.2em) 0.5em;
    background-size:
        6px 6px,
        6px 6px,
        1px 1.6em;
    background-repeat: no-repeat;
}

body.theme-light .standings-filter select {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.04), transparent 55%),
        #eef1f6;
    color: #101623;
    border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
    background-image:
        linear-gradient(45deg, transparent 50%, #101623 50%),
        linear-gradient(135deg, #101623 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
}

.standings-filter select:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.standings-filter select:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.standings-filter select.is-selected {
    border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 55%),
        linear-gradient(140deg, #1b1f24, #101316);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(225, 6, 0, 0.2);
}

body.theme-light .standings-filter select.is-selected {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.05), transparent 55%),
        #eef1f6;
    color: #101623;
    border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
    box-shadow: 0 10px 20px rgba(225, 6, 0, 0.1);
}

.standings-filter select option {
    background: #1b1f24;
    color: #f3f4f6;
}

body.theme-light .standings-filter select option {
    background: #eef1f6;
    color: #101623;
}

.panel-head--race {
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.race-head-meta {
    min-width: 0;
}

.panel h2 {
    margin: 0;
    font-size: 20px;
}

.lock-info {
    font-size: 13px;
    color: var(--muted);
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

.race-sketch {
    width: 132px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 15% 20%, rgba(225, 6, 0, 0.14), transparent 55%),
        rgba(255, 255, 255, 0.02);
    padding: 6px;
    flex: 0 0 auto;
}

.race-sketch--clickable {
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.race-sketch--clickable:hover,
.race-sketch--clickable:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    outline: none;
}

body.theme-light .race-sketch {
    background:
        radial-gradient(circle at 15% 20%, rgba(225, 6, 0, 0.08), transparent 55%),
        rgba(15, 23, 42, 0.02);
}

.hidden {
    display: none;
}

.test-race {
    margin: 10px 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.test-race-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.test-race select {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    font-size: 13px;
}

body.theme-light .test-race select {
    background: #ffffff;
}

.panel-message {
    display: none;
    margin: 12px 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: pre-line;
}

.panel-message.success {
    display: block;
    background: rgba(46, 204, 113, 0.14);
    color: #1e8449;
}

.panel-message.error {
    display: block;
    background: rgba(231, 76, 60, 0.14);
    color: #ffb6ae;
}

.panel-message.info {
    display: block;
    background: rgba(241, 196, 15, 0.18);
    color: #ffdd85;
}

.pick-wrap {
    margin-top: 14px;
    min-width: 0;
}

#drivers.driver-list {
    min-width: 0;
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.actions button {
    flex: 0 1 160px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
}

.actions button.primary {
    border: none;
    background: linear-gradient(120deg, var(--accent), #ff4c3b);
    box-shadow: 0 12px 24px rgba(225, 6, 0, 0.35);
}

.actions button.ghost {
    border-color: rgba(148, 163, 184, 0.5);
    color: #cbd5f5;
    background: rgba(148, 163, 184, 0.08);
}

.mention-box {
    position: relative;
    margin-top: 8px;
}

.compose-inline {
    margin-top: 10px;
}

.mention-box textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    font-size: 14px;
    resize: vertical;
}

.mention-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #1b2434;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: none;
    max-height: 220px;
    overflow: auto;
    z-index: 20;
}

body.theme-light .mention-suggestions {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
}

.mention-suggestions.active {
    display: block;
}

.mention-suggestion {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    cursor: pointer;
}

.mention-suggestion:hover:not(.no-hover) {
    background: rgba(36, 49, 73, 0.8);
}

body.theme-light .mention-suggestion:hover:not(.no-hover) {
    background: rgba(15, 23, 42, 0.08);
}

.mention-tag {
    color: var(--muted);
    font-size: 12px;
}

.prefs-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.prefs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #1b2434;
    border: 1px solid var(--border);
}

body.theme-light .prefs-item {
    background: #f3f5fb;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(5, 8, 16, 0.6);
    padding: 18px;
}

body.theme-light .modal-card {
    background: #ffffff;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.modal-head h3 {
    margin: 0;
    font-size: 18px;
}

.modal-body {
    display: grid;
    gap: 12px;
    font-size: 14px;
}

.help-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
}

.actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.stats-summary {
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}

.stats-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    background: #1b2434;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 6px;
}

body.theme-light .stat-card {
    background: #f3f5fb;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
}

.stats-recent {
    margin-top: 18px;
}

.stats-recent h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.stats-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #1b2434;
    border-left: 4px solid var(--accent-2);
}

body.theme-light .stats-recent-item {
    background: #f3f5fb;
}

.stats-recent-item span {
    font-size: 13px;
}

.stats-recent-points {
    font-weight: 700;
}

.stats-recent-empty {
    color: var(--muted);
    text-align: center;
    padding: 16px 0;
}

.standings-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: grid;
    gap: 10px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.standings-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #1b2434;
    border-left: 6px solid transparent;
}

body.theme-light .standings-item {
    background: #f3f5fb;
}

.standings-item:nth-child(1) {
    border-left-color: #ffb100;
}

.standings-item:nth-child(2) {
    border-left-color: #c0c5d3;
}

.standings-item:nth-child(3) {
    border-left-color: #c06b2e;
}

.standings-rank {
    font-weight: 700;
    color: var(--muted);
}

.standings-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.standings-points {
    font-weight: 700;
}

.standings-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(46, 204, 113, 0.2);
    color: #b6f1cf;
    border: 1px solid rgba(46, 204, 113, 0.4);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.standings-badge-icon {
    width: 12px;
    height: 12px;
    display: inline-block;
    background: currentColor;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2 12l19-9-5 20-6-6-4 2 2-5z' fill='black'/></svg>") no-repeat center / contain;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2 12l19-9-5 20-6-6-4 2 2-5z' fill='black'/></svg>") no-repeat center / contain;
}

body.theme-light .standings-badge {
    background: rgba(46, 204, 113, 0.12);
    color: #0f5132;
    border-color: rgba(46, 204, 113, 0.35);
}

.standings-empty {
    color: var(--muted);
    text-align: center;
    padding: 24px 0;
}

.notifications-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 540px;
    overflow: auto;
    padding-right: 4px;
}

.notification-conversation-separator {
    list-style: none;
    align-self: stretch;
    height: 1px;
    border-top: 1px dashed rgba(255, 255, 255, 0.16);
    margin: 2px 0 4px;
}

body.theme-light .notification-conversation-separator {
    border-top-color: rgba(15, 23, 42, 0.18);
}

.notification-item {
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 12px;
    background: #1b2434;
    border: 1px solid var(--border);
    display: grid;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

body.theme-light .notification-item {
    background: #f3f5fb;
}

.notification-read {
    opacity: 0.6;
}

.notification-unread {
    opacity: 1;
}

.notification-incoming {
    align-self: flex-end;
    border-left: 4px solid rgba(255, 177, 0, 0.65);
}

.notification-outgoing {
    align-self: flex-start;
    border-right: 4px solid rgba(16, 185, 129, 0.7);
    border-left: 1px solid var(--border);
    background: #1a2a2b;
}

body.theme-light .notification-outgoing {
    background: #eaf8f1;
}

.notification-item.notification-threaded {
    align-self: center;
    max-width: 92%;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notification-direction {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.notification-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.reply-toggle {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    line-height: 1;
}

.reply-wrap {
    margin-top: 4px;
}

.reply-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}

.reply-input {
    width: 100%;
    min-height: 66px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    resize: vertical;
    font-size: 13px;
}

.reply-send {
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    background: linear-gradient(120deg, var(--accent), #ff4c3b);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.reply-status {
    margin-top: 6px;
    font-size: 12px;
}

.notification-meta {
    color: var(--muted);
    font-size: 12px;
}

.notification-link {
    margin-top: 4px;
}

.notification-link a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
}

body.theme-light .notification-link a {
    color: var(--accent);
}

.notification-link a:hover {
    text-decoration: underline;
}

.notification-empty {
    color: var(--muted);
    text-align: center;
    padding: 24px 0;
}

.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--accent-2);
    color: #0b1020;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.notif-badge.hidden {
    display: none;
}

.my-picks-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: grid;
    gap: 14px;
}

.my-pick-item {
    padding: 16px;
    border-radius: 14px;
    background: #1b2434;
    border-left: 6px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 10px;
}

body.theme-light .my-pick-item {
    background: #f3f5fb;
}

.my-pick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.my-pick-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.my-pick-actions .ghost {
    padding: 6px 10px;
    font-size: 12px;
}

.my-pick-actions .ghost[data-action="race-standings"]:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    color: var(--muted);
    border-color: color-mix(in srgb, var(--muted) 45%, transparent);
    border-style: dashed;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
    filter: saturate(0.65);
}

.my-pick-actions .ghost[data-action="race-standings"]:disabled::before {
    content: "🔒 ";
}

body.theme-light .my-pick-actions .ghost[data-action="race-standings"]:disabled {
    background: rgba(15, 23, 42, 0.03);
}

.my-pick-title {
    font-weight: 600;
}

.my-pick-meta {
    font-size: 12px;
    color: var(--muted);
}

.my-pick-result {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #182034;
    border: 1px dashed var(--border);
}

body.theme-light .my-pick-result {
    background: #f1f4fb;
}

.my-pick-result-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.my-pick-result-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13px;
}

.result-entry {
    color: var(--text);
}

.my-pick-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 13px;
}

.my-pick-no-bet {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
}

.pick-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 177, 0, 0.2);
    color: #ffd27a;
    font-size: 11px;
    font-weight: 700;
}

.badge--zero {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.my-picks-empty {
    color: var(--muted);
    text-align: center;
    padding: 24px 0;
}

.race-trend-card {
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #1b2434;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 10px;
}

body.theme-light .race-trend-card {
    background: #f3f5fb;
    border-color: rgba(15, 23, 42, 0.06);
}

.race-trend-head h3 {
    margin: 0;
    font-size: 16px;
}

.race-trend-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 12px;
    flex-wrap: wrap;
}

.race-trend-head .muted {
    margin: 4px 0 0;
    font-size: 12px;
}

.race-trend-toggle {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.race-trend-toggle .ghost {
    padding: 6px 10px;
    font-size: 12px;
}

.race-trend-toggle .ghost.active {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--text);
}

.race-trend-status {
    font-size: 13px;
}

.race-trend-chart {
    min-height: 260px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    background: #182034;
    padding: 8px;
    overflow-x: auto;
}

body.theme-light .race-trend-chart {
    background: #f1f4fb;
}

.race-trend-chart svg {
    display: block;
    width: 100%;
    height: auto;
    min-width: 620px;
}

.race-trend-axis {
    stroke: color-mix(in srgb, var(--muted) 55%, transparent);
    stroke-width: 1;
}

.race-trend-grid {
    stroke: color-mix(in srgb, var(--muted) 35%, transparent);
    stroke-width: 1;
    stroke-dasharray: 3 4;
}

.race-trend-label {
    fill: var(--muted);
    font-size: 11px;
    font-family: "Space Grotesk", sans-serif;
}

.race-trend-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.race-trend-point {
    stroke: rgba(11, 16, 32, 0.7);
    stroke-width: 1.25;
}

.race-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.race-trend-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 4px 8px;
}

body.theme-light .race-trend-legend-item {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.08);
}

.race-trend-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.race-standings-list {
    margin-top: 4px;
    max-height: 420px;
}

.race-standings-result {
    margin-top: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

.race-standings-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 12px;
}

.race-standings-main {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.race-standings-item .standings-name {
    min-width: 0;
}

.race-standings-item .standings-points {
    white-space: nowrap;
}

.race-standings-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.race-standings-pick-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text);
}

@media (max-width: 700px) {
    .race-standings-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .race-standings-item .standings-points {
        grid-column: 2;
        justify-self: start;
        font-size: 13px;
    }
}

@media (max-width: 1000px) {
    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        padding-left: 16px;
        padding-right: 16px;
    }

    #drivers.driver-list:not(.grid-mode-f1) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(11, auto);
        grid-auto-flow: column;
        gap: 6px;
        padding-left: 0;
        padding-right: 0;
    }

    #drivers.driver-list.grid-mode-f1 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-flow: row;
        gap: 6px 10px;
        padding-left: 0;
        padding-right: 0;
    }

    #drivers.driver-list .driver {
        padding: 5px 6px;
        min-height: 34px;
        gap: 4px;
    }
}

@media (max-width: 700px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 12px;
        padding-right: 12px;
    }

    .dashboard {
        padding-left: 12px;
        padding-right: 12px;
    }

    .actions {
        flex-direction: row;
    }

    .prefs-list {
        grid-template-columns: 1fr;
    }

    .race-sketch {
        width: 112px;
        height: 64px;
    }

    #drivers.driver-list:not(.grid-mode-f1) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(11, auto);
        grid-auto-flow: column;
        gap: 5px;
    }

    #drivers.driver-list.grid-mode-f1 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-flow: row;
        gap: 5px 10px;
    }

    #drivers.driver-list .driver {
        padding: 4px 6px;
        min-height: 32px;
        font-size: 12px;
    }
}

/* =========================
   TOASTS
   ========================= */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid var(--accent);
}

.toast.info {
    border-left: 4px solid var(--accent-2);
}

/* CUSTOM MODAL / CONFIRM */
.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.custom-modal.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.custom-modal.active .custom-modal-content {
    transform: translateY(0);
}

.custom-modal-body {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
    text-align: center;
}

.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-modal-actions button {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    border: none;
}

.custom-modal-actions .ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.custom-modal-actions .ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.custom-modal-actions .danger {
    background: var(--accent);
    color: white;
}

.custom-modal-actions .danger:hover {
    filter: brightness(1.1);
}
