.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Sleeper Team Viewer ---------- */

:root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --border: #2a2f3a;
    --text: #e8eaed;
    --text-muted: #9aa0ac;
    --accent: #ff6a3d;
    --accent-hover: #ff8459;
    --green: #3ddc84;
    --amber: #f5b942;
    --red: #ef4444;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.site-nav-link {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    z-index: 50;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 480px) {
    .site-nav-link { top: 0.6rem; right: 0.75rem; padding: 0.3rem 0.7rem; font-size: 0.78rem; }
}

a {
    color: var(--accent);
}

.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 480px;
}

.landing-teaser {
    text-align: center;
}

.landing-teaser-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.landing-teaser-pill {
    /* The app's orange accent is already the CTA button below and the primary
       link color everywhere — reusing it here would make these look like more
       buttons. The timing-note teal is otherwise only used for in-app kickoff
       notes, so it reads as a fresh, distinct pop of color against an
       otherwise monochrome page instead of competing with "Find My Teams". */
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #38bdf8;
}

.landing-teaser-link {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.username-form {
    display: flex;
    gap: 0.5rem;
}

.username-input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: var(--text);
    font-size: 1rem;
}

.username-input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page {
    max-width: 780px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--accent);
}

.progress-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.status-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    color: var(--text-muted);
}

.about-feature-list {
    margin: 0 0 1.5rem;
    padding-left: 1.25rem;
    line-height: 1.6;
}

.about-feature-list li {
    margin-bottom: 0.6rem;
}

.about-feature-list li strong {
    color: var(--text);
}

.about-contact-text {
    margin: 0 0 1rem;
    color: var(--text);
}

.about-contact-link {
    display: inline-block;
    text-decoration: none;
}

.status-box.error {
    color: var(--red);
    border-color: var(--red);
}

.user-header, .team-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.team-header {
    justify-content: space-between;
}

.user-header h1, .team-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.muted {
    color: var(--text-muted);
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
}

.section-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 2rem 0 0.75rem;
}

.subsection-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.subsection-title:not(:first-child) {
    margin-top: 1.25rem;
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-2);
}

.avatar-lg { width: 64px; height: 64px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-sm { width: 36px; height: 36px; }

.avatar-wrap {
    display: contents;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
}

.card-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.league-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.league-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.league-card-body {
    flex: 1;
    min-width: 0;
}

.league-name {
    font-weight: 600;
}

.league-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.league-type-tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.chevron {
    color: var(--text-muted);
    font-size: 1.4rem;
}

.record-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-left: 0.6rem;
    vertical-align: middle;
}

.rank-tier-green { background: rgba(61, 220, 132, 0.18); color: var(--green); }
.rank-tier-yellow { background: rgba(245, 185, 66, 0.18); color: var(--amber); }
.rank-tier-red { background: rgba(239, 68, 68, 0.18); color: var(--red); }

.roster-table {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
}

.player-row-highlight {
    border-color: var(--green);
    background: rgba(61, 220, 132, 0.08);
}

.outscore-note {
    color: var(--green);
    font-weight: 600;
}

.player-row-highlight-timing {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.timing-note {
    color: #38bdf8;
    font-weight: 600;
}

.player-slot {
    width: 44px;
    min-height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.1;
    overflow-wrap: break-word;
    border-radius: 8px;
    padding: 0.2rem;
    background: var(--surface-2);
}

.slot-qb { background: #ec4899; }
.slot-rb { background: #22c55e; }
.slot-wr { background: #3b82f6; }
.slot-te { background: #f97316; }
.slot-flex { background: #14b8a6; }
.slot-superflex { background: #8b5cf6; }
.slot-k { background: #64748b; }
.slot-def { background: #78716c; }
.slot-ir { background: #dc2626; }
.slot-bn { background: #475569; color: #cbd5e1; }
.slot-taxi { background: #7c3aed; }
.slot-default { background: var(--surface-2); color: var(--text-muted); }

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-points {
    width: 52px;
    flex-shrink: 0;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-warning { background: rgba(245, 185, 66, 0.18); color: var(--amber); }
.badge-danger { background: rgba(239, 68, 68, 0.18); color: var(--red); }
.badge-danger-light { background: rgba(239, 68, 68, 0.12); color: #f0918a; }
.badge-dark { background: rgba(154, 160, 172, 0.18); color: var(--text-muted); }
.badge-neutral { background: rgba(154, 160, 172, 0.15); color: var(--text-muted); }

.dashboard-link {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: border-color 0.15s ease;
}

.dashboard-link:hover {
    border-color: var(--accent);
}

.team-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-refresh {
    display: inline-block;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-refresh:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: default;
}

.finding-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s ease;
}

.finding-row:hover {
    border-color: var(--accent);
}

.diff-positive {
    color: var(--green);
    width: auto;
}

.dashboard-section {
    margin-bottom: 0.5rem;
}

.free-agent-note {
    margin-top: 0.6rem;
    font-size: 0.8rem;
}

.power-rank-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
}

.power-rank-row.row-tier-green { background: rgba(61, 220, 132, 0.045); border-color: rgba(61, 220, 132, 0.16); }
.power-rank-row.row-tier-yellow { background: rgba(245, 185, 66, 0.045); border-color: rgba(245, 185, 66, 0.16); }
.power-rank-row.row-tier-red { background: rgba(239, 68, 68, 0.045); border-color: rgba(239, 68, 68, 0.16); }

.power-rank-row.power-rank-row-you {
    border-color: var(--accent);
    border-width: 2px;
}

.power-rank-num {
    width: 28px;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.power-rank-stat {
    width: 78px;
    flex-shrink: 0;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.power-rank-stat .muted {
    font-weight: 600;
    margin-right: 0.3rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
}

.modal-close:hover {
    color: var(--text);
}

@media (max-width: 480px) {
    .modal-content { padding: 1rem; max-height: 90vh; }
}

.dashboard-section > summary.section-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-section > summary.section-title::before {
    content: "▾";
    display: inline-block;
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}

.dashboard-section:not([open]) > summary.section-title::before {
    transform: rotate(-90deg);
}

.dashboard-section > summary.section-title::-webkit-details-marker {
    display: none;
}

.dashboard-section > .section-body {
    margin-top: 0.75rem;
}

.league-picker-direct {
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.league-picker-direct:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.league-picker {
    position: relative;
    flex-shrink: 0;
}

.league-picker summary {
    list-style: none;
    cursor: pointer;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.league-picker summary::-webkit-details-marker {
    display: none;
}

.league-picker summary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.league-picker-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 20;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.league-picker-list a {
    display: block;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.3;
}

.league-picker-list a:hover {
    background: var(--surface);
    color: var(--accent);
}

@media (max-width: 480px) {
    .hero-card { padding: 2rem 1.5rem; }
    .username-form { flex-direction: column; }
    .player-slot { display: none; }
    .team-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    /* A hard single-line ellipsis is the wrong tradeoff on a narrow screen — once the
       injury/day badges are already abbreviated (see PlayerRow.InjuryBadgeAbbrev), any
       name that still doesn't fit should wrap onto a second line rather than get cut off. */
    .player-name { white-space: normal; overflow: visible; text-overflow: clip; }

    /* Badges are already showing short text (Q/D/O/IR/MON etc.), but they were sized
       for full words like "QUESTIONABLE" — shrink them so they take less of the row. */
    .badge { font-size: 0.62rem; padding: 0.2rem 0.4rem; }

    /* The "Select team"/"Select league" pill is the single widest fixed element in a
       dashboard row (wider than the injury/day badge), and on rows that have one it was
       squeezing the name down to almost nothing even after the fixes above. */
    .league-picker-direct, .league-picker summary { font-size: 0.68rem; padding: 0.3rem 0.55rem; }
}