/* V2-M9f.3c6: Ocean mode selector belongs to the MAIN page's icon rail.
 * Overrides M9f.3c3's horizontal layout while keeping the verified M9f.3c4
 * V1 Atmosphere sidebar isolation. No scientific or modal JS changes.
 */
#v2-module-home:has(#v2-ocean-workspace:not([hidden]))
#v2-ocean-workspace:not(.is-collapsed) {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* The one Ocean rail is fixed-width and vertical, as in Atmosphere. */
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail {
    position: relative;
    inset: auto;
    z-index: 3;
    display: flex;
    flex: 0 0 40px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 0;
    border-right: 1px solid #e3e7eb;
    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: 0 0 40px;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    line-height: 40px;
    text-align: center;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail button i {
    display: inline-block;
    font-size: 16px;
    line-height: 40px;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-mode-rail #v2-ocean-mode-home {
    margin-top: auto;
    border-top: 1px solid #e3e7eb;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-sidebar-column {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
}
#v2-ocean-workspace:not(.is-collapsed) #v2-ocean-sidebar-scroll {
    flex: 1 1 auto;
    margin-top: 0;
    min-height: 0;
    overflow-y: auto;
}

/* The modal now uses its full width for the editor and source definitions.
 * Existing M9f.3c5 definitions remain available within expanded records.
 * The duplicate modal-only mode buttons are hidden, not used as navigation.
 */
#v2-ocean-workspace #v2-ocean-dialog-mode-nav {
    display: none !important;
}
#v2-ocean-workspace #v2-ocean-editor-dialog-body > #v2-ocean-editor-dialog-content {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

/* Previous M9f.3c3 collapsed-rail behavior remains intact. */
@media (max-width: 660px) {
    #v2-module-home:has(#v2-ocean-workspace:not([hidden]))
    #v2-ocean-workspace:not(.is-collapsed) {
        width: min(390px, 100vw);
    }
}
