/* Classic index.php home — v2 visual language */

:root {
    --v2-bg: #fafbfc;
    --v2-surface: #ffffff;
    --v2-border: #e5e7eb;
    --v2-border-strong: #d1d5db;
    --v2-text: #111827;
    --v2-text-secondary: #6b7280;
    --v2-text-muted: #9ca3af;
    --v2-primary: #0369a1;
    --v2-primary-hover: #0284c7;
    --v2-primary-muted: #f0f9ff;
    --v2-primary-soft: #e0f2fe;
    --v2-danger: #dc2626;
    --v2-success: #059669;
    --v2-success-soft: #ecfdf5;
    --v2-radius-sm: 6px;
    --v2-radius: 10px;
    --v2-radius-lg: 12px;
    --v2-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --v2-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --v2-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --classic-home-pad-x: 28px;
    --classic-sidebar-offset: 252px;
    --v2-cat-aside-min-h: 1040px;
}

html:has(body.classic-home-v2-active) {
    overflow-x: hidden;
    max-width: 100%;
}

body.classic-home-v2-active {
    font-family: var(--v2-font);
    background: var(--v2-bg) !important;
    color: var(--v2-text);
    height: auto !important;
    min-height: 100vh;
    display: block !important;
    align-items: stretch !important;
    padding: 0 !important;
    /* Do not use width:100% here — body already has margin-left for the fixed sidebar. */
    width: auto !important;
    max-width: calc(100vw - var(--classic-sidebar-offset)) !important;
    overflow-x: clip;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body.classic-home-v2-active.sidebar-collapsed {
    --classic-sidebar-offset: 48px;
}

@media (max-width: 768px) {
    body.classic-home-v2-active:not(.sidebar-collapsed) {
        --classic-sidebar-offset: 200px;
    }
}

body.classic-home-v2-active .container#main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 24px var(--classic-home-pad-x) 40px !important;
    text-align: left !important;
    box-sizing: border-box;
    overflow-x: hidden;
}

body.classic-home-v2-active #searchContainer.search-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.classic-home-v2-active #classicHomeChrome {
    max-width: 100%;
    min-width: 0;
}

body.classic-home-v2-active #classicHomeChrome.classic-home {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-sm);
    padding: 20px 22px 22px;
    margin-bottom: 0;
}

body.classic-home-v2-active #searchContainer.search-container.visible {
    display: block;
}

.classic-home {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.classic-home-hero {
    width: 100%;
    min-width: 0;
}

.classic-home-library {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 20px auto 0;
    padding: 20px 22px 22px;
    box-sizing: border-box;
    overflow-x: hidden;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-sm);
}

.classic-home-library__head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--v2-border);
}

.classic-home-library[hidden] {
    display: none !important;
}

.classic-home-library__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--v2-text);
}

.classic-home-library__subtitle {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--v2-text-secondary);
    max-width: 720px;
}

.classic-home-library__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, min(360px, 32vw));
    gap: 20px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.classic-home-library__main {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.classic-home-v2-active #classicHomeLibrary .classic-home-library__head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--v2-border);
}

body.classic-home-v2-active #classicHomeLibrary .classic-home-aside {
    position: relative;
}

body.classic-home-v2-active #classicHomeLibrary .classic-home-aside .v2-cat-panel__header {
    padding: 0 0 14px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--v2-border);
}

.classic-home-library.classic-home-library--aside-collapsed .classic-home-library__layout {
    grid-template-columns: minmax(0, 1fr) 40px;
}

.classic-home-primary {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body.classic-home-v2-active .v2-search-hero,
body.classic-home-v2-active .v2-projects-section,
body.classic-home-v2-active #searchIntroSection {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.classic-home-v2-active .v2-projects-grid {
    min-width: 0;
    max-width: 100%;
}

body.classic-home-v2-active .tutorial-videos-section,
body.classic-home-v2-active #tutorialVideosSection,
body.classic-home-v2-active #classicHomeLibrary,
body.classic-home-v2-active .classic-home-library {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

body.classic-home-v2-active .tutorial-videos-layout,
body.classic-home-v2-active .tutorial-video-list,
body.classic-home-v2-active .tutorial-video-player {
    min-width: 0;
    max-width: 100%;
}

body.classic-home-v2-active .tutorial-video-list {
    overflow: visible;
}

.classic-home-aside {
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-self: start;
    position: relative;
    min-height: var(--v2-cat-aside-min-h);
    height: auto;
    max-height: none;
    overflow: visible;
}

body.classic-home-v2-active #classicHomeLibrary .classic-home-aside .v2-cat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-left: 1px solid var(--v2-border);
    padding-left: 20px;
    margin-left: -1px;
    overflow: hidden;
}

body.classic-home-v2-active .classic-home-aside .v2-cat-panel__collapsible {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

body.classic-home-v2-active .classic-home-aside .v2-cat-scroll {
    min-width: 0;
    flex: 1;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 0;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
}

body.classic-home-v2-active .classic-home-aside .v2-cat-scroll.is-scrollable {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.classic-home-aside[hidden] {
    display: none !important;
}

body.classic-home-v2-active #searchContainer.classic-home--searching ~ #classicHomeLibrary,
body.classic-home-v2-active #searchContainer.classic-home--searching #classicHomeGreeting,
body.classic-home-v2-active #searchContainer.classic-home--searching #searchIntroSection {
    display: none !important;
}

body.classic-home-v2-active .v2-page-header,
body.classic-home-v2-active #classicHomeGreeting {
    margin-bottom: 20px;
    text-align: left;
}

body.classic-home-v2-active #classicHomeLibrary .v2-projects-section {
    margin-top: 16px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

body.classic-home-v2-active .v2-page-header h1,
body.classic-home-v2-active #classicWelcomeGreeting,
body.classic-home-v2-active #classicWelcomeName {
    text-align: left;
}

body.classic-home-v2-active .v2-page-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--v2-text);
}

body.classic-home-v2-active .v2-page-header p {
    margin: 0;
    font-size: 14px;
    color: var(--v2-text-secondary);
    max-width: 640px;
    text-align: left;
}

body.classic-home-v2-active .v2-search-hero {
    padding: 0;
    margin-bottom: 0;
    border-bottom: none;
}

body.classic-home-v2-active #searchIntroSection {
    margin-top: 16px;
}

body.classic-home-v2-active .v2-search-bar,
body.classic-home-v2-active .search-bar-top {
    display: flex;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    margin: 0;
    justify-content: flex-start;
}

body.classic-home-v2-active .v2-search-input,
body.classic-home-v2-active .v2-search-field .v2-search-input,
body.classic-home-v2-active #searchContainer .search-bar-top input[type="text"] {
    flex: 1;
    min-width: 0;
    width: auto !important;
    height: 48px;
    padding: 0 14px !important;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--v2-text);
    box-shadow: none !important;
    text-indent: 0 !important;
}

body.classic-home-v2-active .v2-search-field {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--v2-border-strong) !important;
    border-radius: var(--v2-radius) !important;
    background: var(--v2-surface) !important;
    box-shadow: var(--v2-shadow-sm) !important;
}

body.classic-home-v2-active .v2-search-field:focus-within {
    border-color: var(--v2-primary) !important;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.12) !important;
}

body.classic-home-v2-active .v2-search-field .v2-search-input:focus,
body.classic-home-v2-active #searchContainer .search-bar-top .v2-search-field input[type="text"]:focus {
    outline: none;
    border-color: transparent !important;
    box-shadow: none !important;
}

body.classic-home-v2-active .v2-search-input::placeholder,
body.classic-home-v2-active .v2-search-field .v2-search-input::placeholder,
body.classic-home-v2-active #searchContainer .search-bar-top input[type="text"]::placeholder {
    color: var(--v2-text-muted);
    font-size: 14px;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

body.classic-home-v2-active .v2-search-submit,
body.classic-home-v2-active #searchContainer .search-bar-top button {
    flex-shrink: 0;
    height: 48px !important;
    width: auto !important;
    padding: 0 28px !important;
    border: none !important;
    border-radius: var(--v2-radius) !important;
    background: var(--v2-primary) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--v2-shadow-sm);
}

body.classic-home-v2-active .v2-search-submit:hover:not(:disabled),
body.classic-home-v2-active #searchContainer .search-bar-top button:hover {
    background: var(--v2-primary-hover) !important;
}

/* Saved / shared / universal library: hide search chrome, show project title bar */
body.classic-home-v2-active #searchContainer.project-open--title-mode .v2-search-bar {
    display: none !important;
}

body.classic-home-v2-active .v2-project-title-bar {
    width: 100%;
    margin-top: 0;
}

body.classic-home-v2-active .v2-project-title-bar[hidden],
body.classic-home-v2-active .v2-project-title-bar__view[hidden],
body.classic-home-v2-active .v2-project-title-bar__edit-row[hidden] {
    display: none !important;
}

body.classic-home-v2-active .v2-project-title-bar__view {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--v2-border-strong);
    border-radius: var(--v2-radius);
    background: var(--v2-surface);
    box-shadow: var(--v2-shadow-sm);
    box-sizing: border-box;
}

body.classic-home-v2-active .v2-project-title-bar__text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--v2-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.classic-home-v2-active .v2-project-title-bar__edit {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--v2-border-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--v2-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

body.classic-home-v2-active .v2-project-title-bar__edit:hover {
    background: #f0f7fc;
    border-color: var(--v2-primary);
}

body.classic-home-v2-active .v2-project-title-bar__edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 6px 8px 6px 14px;
    border: 1px solid var(--v2-primary);
    border-radius: var(--v2-radius);
    background: var(--v2-surface);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.12);
    box-sizing: border-box;
}

body.classic-home-v2-active .v2-project-title-bar__input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--v2-text);
    outline: none;
}

body.classic-home-v2-active .v2-project-title-bar__action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--v2-border-strong);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

body.classic-home-v2-active .v2-project-title-bar__action--save {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

body.classic-home-v2-active .v2-project-title-bar__action--save:hover {
    background: #dcfce7;
}

body.classic-home-v2-active .v2-project-title-bar__action--cancel {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

body.classic-home-v2-active .v2-project-title-bar__action--cancel:hover {
    background: #fee2e2;
}

body.classic-home-v2-active #searchWarning.v2-search-warning {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--v2-danger);
    text-align: center;
}

body.classic-home-v2-active #recentSearches.v2-recent-searches,
body.classic-home-v2-active .v2-recent-searches {
    margin-top: 3px;
    padding-top: 4px;
}

body.classic-home-v2-active .v2-recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.classic-home-v2-active .v2-recent-item {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--v2-border);
    border-radius: 999px;
    background: var(--v2-surface);
    overflow: hidden;
    min-height: 32px;
    box-shadow: var(--v2-shadow-sm);
}

body.classic-home-v2-active .v2-recent-chip {
    border: none;
    background: transparent;
    color: var(--v2-text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}

body.classic-home-v2-active .v2-recent-chip:hover {
    color: var(--v2-primary);
    background: var(--v2-primary-muted);
}

body.classic-home-v2-active .v2-recent-remove {
    border: none;
    border-left: 1px solid var(--v2-border);
    background: transparent;
    color: var(--v2-text-muted);
    font-size: 14px;
    line-height: 1;
    padding: 0 10px;
    cursor: pointer;
    align-self: stretch;
    display: flex;
    align-items: center;
}

body.classic-home-v2-active .v2-recent-remove:hover {
    color: var(--v2-danger);
    background: #fef2f2;
}

body.classic-home-v2-active .search-tiles-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--v2-text-muted);
    margin: 0 0 10px;
}

body.classic-home-v2-active .search-tiles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    margin-bottom: 8px;
}

body.classic-home-v2-active .search-tile {
    flex-direction: row;
    min-height: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    box-shadow: none;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    gap: 6px;
}

body.classic-home-v2-active .search-tile i {
    font-size: 12px;
    margin: 0;
    color: var(--v2-primary);
}

body.classic-home-v2-active .search-tile span {
    font-size: 12px;
    color: var(--v2-text-secondary);
    width: auto;
}

body.classic-home-v2-active .search-tile:hover {
    background: var(--v2-primary-muted);
    border-color: var(--v2-primary);
    box-shadow: none;
}

body.classic-home-v2-active .search-tile:hover span {
    color: var(--v2-primary);
}

body.classic-home-v2-active .v2-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: var(--v2-radius-sm);
    background: transparent;
    color: var(--v2-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

body.classic-home-v2-active .v2-btn-ghost:hover {
    background: #f3f4f6;
    color: var(--v2-text);
}

body.classic-home-v2-active .v2-card {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-sm);
}

body.classic-home-v2-active #classicHomeLibrary.classic-home-library--no-ul {
    display: none !important;
}

/* Aside header toggle — inline next to Spend categories title */
.v2-ul-aside-toggle-btn {
    position: static;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body.classic-home-v2-active #classicHomeLibrary .v2-cat-panel__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

body.classic-home-v2-active #classicHomeLibrary .v2-cat-panel__title-row .v2-cat-panel__title {
    margin: 0;
    min-width: 0;
}

.v2-ul-aside-toggle-btn:hover {
    background: #f3f4f6;
    color: #0369a1;
    border-color: #d1d5db;
}

.v2-ul-aside-toggle-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.classic-home-aside.is-collapsed {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    height: auto;
    max-height: none;
    z-index: 2;
    overflow: visible;
    align-self: start;
}

.classic-home-aside.is-collapsed .v2-cat-panel {
    display: flex !important;
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: 0;
    border-left: 1px solid var(--v2-border);
    padding-left: 0;
    margin-left: -1px;
    box-shadow: none;
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-radius: 0;
    background: transparent;
}

.classic-home-aside.is-collapsed .v2-cat-panel__collapsible,
.classic-home-aside.is-collapsed .v2-cat-panel__subtitle,
.classic-home-aside.is-collapsed .v2-cat-breadcrumb,
.classic-home-aside.is-collapsed .v2-cat-search-wrap,
.classic-home-aside.is-collapsed .v2-cat-toolbar {
    display: none !important;
}

.classic-home-aside.is-collapsed .v2-cat-panel__title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.classic-home-aside.is-collapsed .v2-cat-panel__header {
    padding: 0;
    margin: 0;
    border-bottom: none;
}

.classic-home-aside.is-collapsed .v2-cat-panel__title-row {
    margin: 0;
    justify-content: flex-end;
    min-height: 28px;
}

.classic-home-aside.is-collapsed .v2-ul-aside-toggle-btn {
    transform: rotate(180deg);
    width: 28px;
    height: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-radius: 6px;
}

@media (max-width: 1100px) {
    .classic-home-library__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .classic-home-aside:not(.is-collapsed) {
        position: relative;
        min-height: min(var(--v2-cat-aside-min-h), 55vh);
        height: auto;
        max-height: min(55vh, var(--v2-cat-aside-min-h));
    }

    .classic-home-aside:not(.is-collapsed) .v2-cat-panel {
        max-height: min(55vh, var(--v2-cat-aside-min-h));
    }

    .classic-home-library.classic-home-library--aside-collapsed .classic-home-library__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .classic-home-aside.is-collapsed {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        min-height: 0;
        height: auto;
        max-height: none;
        margin-top: 0;
    }

    .classic-home-aside.is-collapsed .v2-cat-panel {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    body.classic-home-v2-active #classicHomeLibrary .classic-home-aside:not(.is-collapsed) .v2-cat-panel {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--v2-border);
    }
}

@media (max-width: 640px) {
    :root {
        --classic-home-pad-x: 16px;
    }

    body.classic-home-v2-active .container#main {
        padding: 16px var(--classic-home-pad-x) 32px !important;
    }

    body.classic-home-v2-active .v2-search-bar,
    body.classic-home-v2-active .search-bar-top {
        flex-direction: column;
    }

    body.classic-home-v2-active .v2-search-submit,
    body.classic-home-v2-active #searchContainer .search-bar-top button {
        width: 100% !important;
    }
}

/* -------------------------------------------------------------------------
   Project analysis tabs — v2 layout & colors (index.php tab-container)
   ------------------------------------------------------------------------- */

body.classic-home-v2-active #tab-container.tab-container:not(.hide) {
    margin-top: 20px;
}

body.classic-home-v2-active .project-tabs-bar {
    align-items: stretch;
    gap: 12px;
}

body.classic-home-v2-active .project-tabs-strip {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-bottom: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg) var(--v2-radius-lg) 0 0;
    box-shadow: var(--v2-shadow-sm);
    padding: 6px 10px 0;
}

body.classic-home-v2-active .project-tabs-list {
    gap: 2px;
    padding: 0;
    align-items: flex-end;
}

body.classic-home-v2-active .project-tabs-list::-webkit-scrollbar-thumb {
    background: var(--v2-border-strong);
    border-radius: 4px;
}

body.classic-home-v2-active .project-tabs-bar .tab-button {
    min-width: 0;
    padding: 10px 18px;
    border: none;
    border-radius: var(--v2-radius-sm) var(--v2-radius-sm) 0 0;
    background-color: transparent;
    color: var(--v2-text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    background-image: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 15%,
        var(--v2-border-strong) 15%,
        var(--v2-border-strong) 85%,
        transparent 85%,
        transparent 100%
    );
    background-size: 1px 100%;
    background-position: right center;
    background-repeat: no-repeat;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

body.classic-home-v2-active .project-tabs-bar .tab-button:not(.hide) + .tab-button:not(.hide) {
    margin-left: 0;
    box-shadow: none;
}

body.classic-home-v2-active .project-tabs-bar .tab-button:hover:not(.active) {
    background-color: var(--v2-primary-muted);
    color: var(--v2-primary);
}

body.classic-home-v2-active .project-tabs-bar .tab-button.active {
    z-index: 1;
    margin-bottom: -1px;
    padding-bottom: 11px;
    background-color: var(--v2-surface);
    color: var(--v2-primary);
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--v2-primary);
    border-radius: var(--v2-radius-sm) var(--v2-radius-sm) 0 0;
    box-shadow: none;
    overflow: visible;
    background-image: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 15%,
        var(--v2-border-strong) 15%,
        var(--v2-border-strong) 85%,
        transparent 85%,
        transparent 100%
    );
    background-size: 1px 100%;
    background-position: right center;
    background-repeat: no-repeat;
}

body.classic-home-v2-active .project-tabs-bar .tab-button.active::before,
body.classic-home-v2-active .project-tabs-bar .tab-button.active::after {
    display: none;
    content: none;
    box-shadow: none;
    background: none;
}

body.classic-home-v2-active .project-tabs-bar .tab-button.disabled {
    opacity: 0.45;
    color: var(--v2-text-muted);
}

body.classic-home-v2-active .project-tabs-bar .tab-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-width: 46px;
    padding: 0 16px;
    margin: 0;
    background-color: transparent;
    color: var(--v2-text-secondary);
    font-size: 22px;
    font-weight: 400;
    line-height: 0;
    border: none;
    border-radius: var(--v2-radius-sm) var(--v2-radius-sm) 0 0;
    box-shadow: none;
}

body.classic-home-v2-active .project-tabs-bar .tab-add-button:hover {
    background-color: var(--v2-primary-muted);
    color: var(--v2-primary);
    border: none;
    box-shadow: none;
}

body.classic-home-v2-active .project-tabs-bar .tab-add-button:focus-visible {
    outline: 2px solid var(--v2-primary);
    outline-offset: 2px;
}

body.classic-home-v2-active .project-tabs-bar .save-button-container {
    display: flex;
    align-items: center;
    align-self: stretch;
    padding: 0 0 0 4px;
    border: none;
}

body.classic-home-v2-active .project-tabs-bar .save-button-container button {
    border-radius: var(--v2-radius-sm);
    font-family: var(--v2-font);
    font-size: 13px;
    font-weight: 600;
}

body.classic-home-v2-active .project-tabs-bar #saveProject,
body.classic-home-v2-active .project-tabs-bar #updateProject {
    position: static;
    top: auto;
    right: auto;
    margin: 0;
    align-self: center;
}

body.classic-home-v2-active .tab-content {
    padding: 20px 22px 24px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-top: none;
    border-radius: 0 0 var(--v2-radius-lg) var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-sm);
}

body.classic-home-v2-active #priceAnalysis,
body.classic-home-v2-active #costAnalysis,
body.classic-home-v2-active #breakthroughSavings,
body.classic-home-v2-active #documents {
    border: 1px solid var(--v2-border) !important;
    border-top: none !important;
    border-radius: 0 0 var(--v2-radius-lg) var(--v2-radius-lg);
}

/* Breakthrough Savings — inner stage tabs */
body.classic-home-v2-active .breakthrough-subtabs {
    background: var(--v2-surface);
    border-radius: var(--v2-radius);
}

body.classic-home-v2-active .breakthrough-subtabs__nav {
    gap: 8px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--v2-border);
    background: transparent;
}

body.classic-home-v2-active .breakthrough-subtabs__btn {
    padding: 8px 14px;
    background: var(--v2-surface);
    color: var(--v2-text-secondary);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--v2-font);
    box-shadow: var(--v2-shadow-sm);
}

body.classic-home-v2-active .breakthrough-subtabs__btn:hover {
    background: var(--v2-primary-muted);
    color: var(--v2-primary);
    border-color: var(--v2-primary-soft);
}

body.classic-home-v2-active .breakthrough-subtabs__btn.active {
    background: var(--v2-primary);
    color: #fff;
    border-color: var(--v2-primary);
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.22);
}

body.classic-home-v2-active .breakthrough-subtabs__btn:focus-visible {
    outline: 2px solid var(--v2-primary);
    outline-offset: 2px;
}

body.classic-home-v2-active .breakthrough-subtabs__panels {
    padding: 20px 0 8px;
    background: transparent;
}

@media (max-width: 768px) {
    body.classic-home-v2-active .project-tabs-bar {
        flex-direction: column;
        align-items: stretch;
    }

    body.classic-home-v2-active .project-tabs-bar .save-button-container {
        justify-content: flex-end;
        padding: 8px 0 0;
    }

    body.classic-home-v2-active .project-tabs-bar .tab-button {
        padding: 9px 14px;
        font-size: 13px;
    }
}
