/* V2-M9f.3c3: one expanded Ocean sidebar, not a separate side-by-side rail.
 * The underlying Atmosphere map is left unchanged. All Ocean control IDs,
 * controller event wiring, mode authority, and modal behavior remain intact.
 * Source: #v2-ocean-mode-rail and #v2-ocean-sidebar-column both belong to Ocean.
 */
#v2-module-home:has(#v2-ocean-workspace:not([hidden]))
#v2-ocean-workspace:not(.is-collapsed) {
    display: flex;
    flex-direction: column;
}

/* Place the four Ocean modes + Home in one horizontal navigation row.
   The blue Ocean title remains at the top of the SAME sidebar. */
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail {
    position: absolute;
    inset: 40px 0 auto 0;
    z-index: 4;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    background: #f8fafc;
    border: 0;
    border-bottom: 1px solid #dce5ee;
    box-shadow: none;
    overflow: hidden;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail button,
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail #v2-ocean-mode-home {
    display: block;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 43px;
    min-height: 43px;
    margin: 0;
    padding: 0;
    border: 0;
    border-right: 1px solid #e7edf4;
    border-radius: 0;
    line-height: 43px;
    text-align: center;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail button i {
    font-size: 16px;
    line-height: 43px;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail #v2-ocean-sidebar-expand {
    display: none;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail #v2-ocean-mode-home {
    margin-top: 0;
    border-top: 0;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-sidebar-column {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
}
/* Reserve the row's height without scrolling the title or mode controls. */
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-sidebar-scroll {
    margin-top: 44px;
    min-height: 0;
}

/* The existing collapsed rail is essential for keyboard access and re-expand.
   It is the ONLY visible Ocean column while collapsed. */
#v2-module-home:has(#v2-ocean-workspace:not([hidden]))
#v2-ocean-workspace.is-collapsed {
    display: flex;
    flex-direction: row;
    width: 40px;
    max-width: 40px;
}
#v2-ocean-workspace.is-collapsed #v2-ocean-mode-rail {
    position: relative;
    inset: auto;
    display: flex;
    flex: 0 0 40px;
    flex-direction: column;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 100%;
}
#v2-ocean-workspace.is-collapsed #v2-ocean-sidebar-column {
    display: none;
}

@media (max-width: 660px) {
    #v2-module-home:has(#v2-ocean-workspace:not([hidden]))
    #v2-ocean-workspace:not(.is-collapsed) {
        width: min(390px, 100vw);
    }
}
