/* ============================================
   EasyFPL — Sidebar nav + flyout sub-nav + palette
   Scoped entirely to .v2-theme (set on <html> by every page using this
   design) — does not affect any other page sharing common.css.
   ============================================ */

:root {
    --v2-sidebar-w: 232px;
    --v2-sidebar-w-collapsed: 76px;
    --v2-page-title-size: clamp(56px, 7.5vw, 104px);
    --v2-page-title-spacing: -6px;
    --v2-page-gutter: 32px;
    --v2-page-title-top: 40px;
}

/* V2 uses one typeface throughout. This also catches older page-specific and
   dynamically rendered rules that still name Space Grotesk, Georgia, etc. */
html.v2-theme body,
html.v2-theme body * {
    font-family: var(--font-body) !important;
}

/* Keep every tool-page heading on the same grid as the dashboard greeting. */
.v2-theme .v2-main-content > main.main-content,
.v2-theme .v2-main-content > main.content {
    max-width: 1440px !important;
    padding-top: var(--v2-page-title-top) !important;
    padding-right: var(--v2-page-gutter) !important;
    padding-left: var(--v2-page-gutter) !important;
}

.v2-theme .news-page-header {
    max-width: 1440px !important;
    padding: var(--v2-page-title-top) var(--v2-page-gutter) 0 !important;
}

.v2-theme .v2-page-hint {
    display: flex;
    align-items: center;
    min-height: 36px;
    margin: 0 0 14px;
    padding: 8px 14px;
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: var(--radius-md);
    background: rgba(96, 165, 250, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.v2-theme .v2-page-heading {
    font-family: var(--font-display) !important;
    font-size: var(--v2-page-title-size) !important;
    line-height: 0.95 !important;
    font-weight: 600 !important;
    letter-spacing: var(--v2-page-title-spacing) !important;
    color: var(--color-primary-muted) !important;
    opacity: 1;
}

@media (max-width: 768px) {
    :root {
        --v2-page-title-size: clamp(46px, 13vw, 64px);
        --v2-page-gutter: 20px;
        --v2-page-title-top: 28px;
    }
}

/* The page shell owns navigation animation. Disabling the browser snapshot
   transition prevents a second full-page fade from washing over it. */
@view-transition {
    navigation: none;
}

::view-transition-group(root) {
    animation: none;
}

::view-transition-old(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

html.v2-theme-transition::view-transition-old(root) {
    animation: v2-theme-old 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
    mix-blend-mode: normal;
}

html.v2-theme-transition::view-transition-new(root) {
    animation: v2-theme-new 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
    mix-blend-mode: normal;
}

@keyframes v2-theme-old {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes v2-theme-new {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Reserve the final layout before sidebar-nav.js starts the reveal. This is
   what prevents already-visible content from blinking out and back in. */
.v2-theme body:not(.v2-sequence-ready) .v2-page-heading,
.v2-theme body:not(.v2-sequence-ready) .v2-main-content > .tabs-container,
.v2-theme body:not(.v2-sequence-ready) .v2-main-content > .ticker-bar,
.v2-theme body:not(.v2-sequence-ready) .v2-main-content > .news-strip,
.v2-theme body:not(.v2-sequence-ready) .v2-main-content > .price-ticker-bar,
.v2-theme body:not(.v2-sequence-ready) main.main-content > *:not(.header-row):not(.loading-overlay),
.v2-theme body:not(.v2-sequence-ready) main.content > *:not(.v2-page-heading),
.v2-theme body:not(.v2-sequence-ready) .hero-banner .hero-inner > *,
.v2-theme body:not(.v2-sequence-ready) #newsDisplay {
    opacity: 0;
}

/* Shared staged page entrance. Elements are marked by sidebar-nav.js only
   after the sidebar and the page shell both exist, preventing partial paints. */
.v2-enter-sidebar,
.v2-enter-topbar,
.v2-enter-heading,
.v2-enter-block {
    opacity: 0;
    will-change: opacity;
}

.v2-enter-topbar {
    transform: translateY(-6px);
    will-change: opacity, transform;
}

.v2-sequence-ready .v2-enter-sidebar {
    animation: v2-sidebar-enter 720ms cubic-bezier(0.22, 1, 0.36, 1) 20ms both;
}

.v2-sequence-ready .v2-enter-topbar {
    animation: v2-topbar-enter 760ms cubic-bezier(0.22, 1, 0.36, 1) 180ms both;
}

.v2-sequence-ready .v2-enter-heading {
    animation: v2-content-enter 800ms cubic-bezier(0.22, 1, 0.36, 1) 320ms both;
}

.v2-sequence-ready .v2-enter-block {
    animation: v2-content-enter 860ms cubic-bezier(0.22, 1, 0.36, 1)
        calc(480ms + (var(--v2-enter-order, 0) * 90ms)) both;
}

/* Content arriving from an API joins the sequence at once rather than waiting
   through the shell's initial delay again. */
.v2-sequence-ready .v2-enter-block.v2-enter-late {
    animation-delay: calc(40ms + (var(--v2-enter-order, 0) * 80ms));
}

@keyframes v2-sidebar-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes v2-topbar-enter {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes v2-content-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Older page styles contain their own entrance animations. The shared shell
   replaces them on V2 pages so panels never animate twice. */
.v2-theme .my-team-dashboard-top,
.v2-theme .squad-alerts-panel,
.v2-theme .transfer-rec,
.v2-theme .verdict-section,
.v2-theme .lo-section,
.v2-theme .ts-section,
.v2-theme .na-section,
.v2-theme .so-section,
.v2-theme .ta-section {
    animation: none !important;
}

/* Players and Teams already reserve their final layout with skeleton content.
   Their legacy full-viewport loaders covered that layout during navigation and
   caused the pale/blank flash visible in recordings. */
.v2-theme .v2-main-content > .loading-overlay {
    background: transparent !important;
    backdrop-filter: none !important;
    pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(root),
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }

    html.v2-theme-transition::view-transition-old(root),
    html.v2-theme-transition::view-transition-new(root) {
        animation: none !important;
    }

    .v2-enter-sidebar,
    .v2-enter-topbar,
    .v2-enter-heading,
    .v2-enter-block {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== NEW COLOR PALETTE (values only — same variable names as common.css,
   so every existing component picks these up automatically) ===== */
.v2-theme {
    --surface-bg: #EAEAE8;
    --surface-0: #FFFFFF;
    --surface-1: #FFFFFF;
    --surface-2: #F1F1EF;
    --surface-3: #E6E6E3;
    --surface-4: #D3D3D3;

    --color-primary: #10B981;
    --color-primary-hover: #059669;
    --color-primary-muted: rgba(16, 185, 129, 0.10);
    --color-primary-glow: rgba(16, 185, 129, 0.25);
    --color-primary-text: #065F46;

    --text-primary: #100F0F;
    --text-secondary: #636363;
    /* Was #A4A4A4 — 2.49:1 on white, barely half the 4.5:1 WCAG AA needs for
       body text, on the theme that ships by default. Darkened until it clears
       AA on the surfaces it actually sits on (white 5.49, surface-2 4.85,
       page background 4.56). It now sits closer to --text-secondary than a
       'muted' token ideally would; legibility is the better trade.
       Known residual: on --surface-3 (#E6E6E3) this reads 4.39:1, just under
       the 4.5 bar. Going darker would make it indistinguishable from
       --text-secondary (#636363), so the small badges that pair the two are
       left at 4.39 rather than collapsing the hierarchy for 0.11. */
    --text-muted: #696969;

    --border-subtle: #EDEDEB;
    --border-default: transparent;
    --border-emphasis: #E4E4E1;
    --shadow-sm: 0 1px 2px rgba(17, 15, 15, 0.05), 0 1px 3px rgba(17, 15, 15, 0.06);

    /* New secondary accent (maroon) — not in the base palette, used for
       featured/highlight moments (banners, star badges). */
    --color-accent-2: #7A2233;
    --color-accent-2-hover: #631B29;
    --color-accent-2-muted: rgba(122, 34, 51, 0.10);
    --color-accent-2-text: #7A2233;
}

.v2-theme[data-theme="dark"] {
    --surface-bg: #15191F;
    --surface-0: #15191F;
    --surface-1: #1B2027;
    --surface-2: #232A33;
    --surface-3: #2E3742;
    --surface-4: #3A4552;

    --color-primary: #00E57D;
    --color-primary-hover: #2AED97;
    --color-primary-muted: rgba(0, 229, 125, 0.14);
    --color-primary-glow: rgba(0, 229, 125, 0.28);
    --color-primary-text: #00E57D;
    --color-success: #00E57D;
    --color-warning: #FFB000;
    --color-error: #FF4D5A;
    --color-info: #939CAA;

    --text-primary: #F4F5F7;
    --text-secondary: #C5CBD4;
    /* Cleared AA on the base surfaces but fell to 4.35:1 on surface-3 and
       3.52:1 on surface-4, which small badges do use. Lifted to pass on both. */
    --text-muted: #A8B1BF;

    --border-subtle: #20262E;
    --border-default: transparent;
    --border-emphasis: #303944;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);

    --color-accent-2: #C1495F;
    --color-accent-2-hover: #D4738A;
    --color-accent-2-muted: rgba(193, 73, 95, 0.18);
    --color-accent-2-text: #D4738A;
}

/* ===== SIDEBAR SHELL ===== */
.v2-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--v2-sidebar-w);
    background: var(--surface-0);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    gap: 20px;
    z-index: 50;
    overflow-y: visible;
}

.v2-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-shrink: 0;
}

.v2-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.v2-sidebar-logo .icon {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.v2-sidebar-logo b {
    color: var(--color-primary);
    font-weight: 600;
}

.v2-sidebar-collapse {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 180ms ease, color 180ms ease;
}

.v2-sidebar-collapse:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.v2-sidebar-collapse .icon {
    width: 17px;
    height: 17px;
}

.v2-sidebar-collapse .v2-expand-icon {
    display: none;
}

/* Width transitions are enabled only for a deliberate toggle click. Keeping
   them off during startup prevents the saved state from widening on load. */
.v2-sidebar-resizing .v2-sidebar {
    transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.v2-sidebar-resizing .v2-main-content {
    transition: margin-left 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.v2-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
}

.v2-sidebar-group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 10px;
    margin-bottom: 6px;
}

.v2-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
    position: relative;
}

.v2-nav-item .icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.v2-nav-item:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.v2-nav-item.active {
    background: var(--color-primary-muted);
    color: var(--color-primary-text);
}

.v2-nav-item.active .icon {
    color: var(--color-primary);
}

.v2-nav-item.active::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 62%;
    border-radius: 0 4px 4px 0;
    background: var(--color-primary);
}

/* ===== FLYOUT SUB-NAV ===== */
.v2-nav-group {
    position: relative;
}

.v2-flyout-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.v2-flyout-toggle .icon {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.v2-nav-group.open .v2-flyout-toggle .icon {
    transform: rotate(90deg);
}

.v2-flyout-toggle:hover {
    background: var(--surface-3);
}

.v2-flyout-panel {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    min-width: 480px;
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4px 20px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 60;
}

.v2-nav-group.open .v2-flyout-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.v2-flyout-group-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 8px;
}

.v2-flyout-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
}

.v2-flyout-item:hover {
    background: var(--surface-2);
}

.v2-flyout-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.v2-flyout-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.v2-flyout-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ===== SIDEBAR BOTTOM (team ID + theme toggle) ===== */
.v2-sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-default);
    flex-shrink: 0;
}

.v2-sidebar-team-id #navTidInput {
    padding: 0 2px;
}

.v2-tid-form {
    display: flex;
    gap: 6px;
}

.v2-tid-form input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--surface-2);
    color: var(--text-primary);
    font-size: 12px;
}

.v2-sidebar-team-id #navTidBadge {
    padding: 0 2px;
}

.v2-sidebar-team-id .nav-tid-badge {
    width: 100%;
    justify-content: space-between;
}

.v2-theme-switch {
    width: 100%;
    height: 38px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3px;
    border: 1px solid var(--border-emphasis);
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.v2-theme-switch::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 11px) / 2);
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--surface-0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transform: translateX(calc(100% + 3px));
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 260ms ease, box-shadow 260ms ease;
}

[data-theme="dark"] .v2-theme-switch::before {
    transform: translateX(0);
    background: #343D49;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.v2-theme-option {
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 260ms ease, background 260ms ease, box-shadow 260ms ease;
    position: relative;
    z-index: 1;
}

.v2-theme-option .icon {
    width: 15px;
    height: 15px;
}

html:not([data-theme="dark"]) .v2-theme-light,
[data-theme="dark"] .v2-theme-dark {
    color: var(--text-primary);
}

[data-theme="dark"] .v2-theme-switch {
    background: #202730;
    border-color: #343E4A;
}

[data-theme="dark"] .v2-theme-dark {
    color: var(--color-primary);
}

/* ===== MAIN CONTENT OFFSET ===== */
html.v2-theme body {
    background: var(--surface-0);
}

.v2-main-content {
    margin-left: var(--v2-sidebar-w);
    min-height: 100vh;
    background: linear-gradient(160deg, #DDEFE4 0%, #F1FAF5 48%, #FFFFFF 100%);
    border-radius: 32px 0 0 32px;
    background-clip: padding-box;
}
[data-theme="dark"] .v2-main-content {
    background: linear-gradient(160deg, #15191F 0%, #17201D 52%, #18241F 100%);
}

/* The first sub-navigation/marquee follows the shell's curved top edge rather
   than painting a square corner over it. */
.v2-main-content > :is(.tabs-container, .ticker-bar, .news-strip, .price-ticker-bar):first-child {
    border-top-left-radius: 32px;
}

@media (max-width: 768px) {
    .v2-main-content {
        border-radius: 24px 0 0 24px;
    }

    .v2-main-content > :is(.tabs-container, .ticker-bar, .news-strip, .price-ticker-bar):first-child {
        border-top-left-radius: 24px;
    }
}

/* User-controlled desktop icon rail. */
.v2-sidebar-collapsed .v2-sidebar {
    width: var(--v2-sidebar-w-collapsed);
    padding: 20px 10px;
    align-items: center;
}

.v2-sidebar-collapsed .v2-sidebar-header {
    width: 100%;
    justify-content: center;
    gap: 2px;
}

.v2-sidebar-collapsed .v2-sidebar-logo {
    padding: 0;
}

.v2-sidebar-collapsed .v2-sidebar-logo span,
.v2-sidebar-collapsed .v2-nav-item > span,
.v2-sidebar-collapsed .v2-sidebar-group-label,
.v2-sidebar-collapsed .v2-sidebar-team-id {
    display: none;
}

.v2-sidebar-collapsed .v2-sidebar-bottom {
    width: 52px;
}

.v2-sidebar-collapsed .v2-theme-switch {
    height: 34px;
    padding: 3px;
    gap: 2px;
}

.v2-sidebar-collapsed .v2-theme-option {
    height: 26px;
}

.v2-sidebar-collapsed .v2-theme-switch::before {
    top: 3px;
    left: 3px;
    width: calc((100% - 8px) / 2);
    height: 26px;
    transform: translateX(calc(100% + 2px));
}

[data-theme="dark"].v2-sidebar-collapsed .v2-theme-switch::before {
    transform: translateX(0);
}

.v2-sidebar-collapsed .v2-theme-option .icon {
    width: 13px;
    height: 13px;
}

.v2-sidebar-collapsed .v2-nav-item {
    justify-content: center;
    padding: 10px;
    width: 44px;
}

.v2-sidebar-collapsed .v2-flyout-toggle {
    display: none;
}

.v2-sidebar-collapsed .v2-sidebar-collapse .v2-collapse-icon {
    display: none;
}

.v2-sidebar-collapsed .v2-sidebar-collapse .v2-expand-icon {
    display: block;
}

.v2-sidebar-collapsed .v2-main-content {
    margin-left: var(--v2-sidebar-w-collapsed);
}

/* ===== LIGHT CARD-AESTHETIC BOOST (scoped, doesn't touch other pages) ===== */
.v2-main-content .hss-card,
.v2-main-content .hero-squad-panel,
.v2-main-content .hero-deadline-banner,
.v2-main-content .rec-card,
.v2-main-content .route-card,
.v2-main-content .chart-card,
.v2-main-content .stats-container,
.v2-main-content .teams-grid > * {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-xl);
}

[data-theme="dark"] .v2-main-content .hss-card,
[data-theme="dark"] .v2-main-content .hero-squad-panel,
[data-theme="dark"] .v2-main-content .hero-deadline-banner,
[data-theme="dark"] .v2-main-content .rec-card,
[data-theme="dark"] .v2-main-content .route-card,
[data-theme="dark"] .v2-main-content .chart-card,
[data-theme="dark"] .v2-main-content .stats-container {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== RESPONSIVE: icon-only rail on narrow screens ===== */
@media (max-width: 900px) {
    .v2-sidebar-collapse {
        display: none;
    }

    .v2-sidebar {
        width: var(--v2-sidebar-w-collapsed);
        padding: 20px 10px;
        align-items: center;
    }

    .v2-sidebar-logo span,
    .v2-nav-item span,
    .v2-sidebar-group-label {
        display: none;
    }

    .v2-nav-item {
        justify-content: center;
        padding: 10px;
        width: 44px;
    }

    .v2-flyout-toggle {
        display: none;
    }

    .v2-nav-group:hover .v2-flyout-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .v2-main-content {
        margin-left: var(--v2-sidebar-w-collapsed);
    }

    /* Team ID widget stays usable in collapsed mode — stacked, full-width
       within the narrow rail, instead of being hidden with no alternative. */
    .v2-tid-form {
        flex-direction: column;
    }

    .v2-tid-form input {
        width: 56px;
        font-size: 10px;
        padding: 5px 6px;
        text-align: center;
    }

    .v2-tid-form .btn {
        padding: 5px 6px;
        font-size: 11px;
    }

    .v2-sidebar-team-id .nav-tid-badge {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 4px;
        font-size: 9px;
    }
}

/* ===== STICKY-OFFSET FIX =====
   Several shared/page components are position:sticky with a hardcoded
   top offset sized to clear the old 56px .top-nav bar (e.g. tabs-container
   at top:56px, filter-bar at top:91px = 56 + tabs-container's own height).
   The sidebar layout has no top bar, so every one of these offsets is
   subtracted by exactly 56px here — preserving how they stack relative
   to each other, just removing the space that used to be reserved for
   the nav that no longer exists in this layout. */
.v2-main-content .tabs-container {
    top: 0;
}

.v2-main-content .tabs-container.tabs-hidden ~ .filter-bar {
    top: 0;
}

.v2-main-content .filter-bar {
    top: 35px; /* was 91px (56px nav + 35px tabs-container height) */
}

.v2-main-content .tw-budget-bar-top {
    top: 0;
}

.v2-main-content .tw-scout-col {
    top: 64px; /* was 120px (56px nav + 64px budget bar) */
}

/* ===== Touch targets =====
   Measured at a 500px viewport: seven classes of control rendered under the
   44px minimum, the worst being icon buttons at 18x18 and 22x15. Rather than
   inflate them visually, an ::after overlay extends the hit area beyond the
   painted box — the control looks identical and the thumb gets a real target.
   Pointer-coarse only, so mouse layouts are untouched. */
@media (pointer: coarse), (max-width: 767px) {
    .nav-tid-change,
    .v2-theme-switch,
    .footer-mail,
    .footer-links a { position: relative; }

    .nav-tid-change::after,
    .v2-theme-switch::after,
    .footer-mail::after,
    .footer-links a::after {
        content: ''; position: absolute; left: 50%; top: 50%;
        transform: translate(-50%, -50%);
        width: 100%; height: 44px; min-width: 44px;
    }

    .v2-nav-item { min-height: 44px; }
}
